Sie sind nicht angemeldet.

1

Mittwoch, 6. Juli 2011, 16:20

removeplugin

Hi all, and Klaus

I try to remove plugin by lot, but it's doesn't work

eg I want to remove all the plugin photo_0, 1,2,3,4 etc..
but removeplugin(thumb_1%) not working only removeplugin(1%) works but all the plugin gone

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

2

Mittwoch, 6. Juli 2011, 20:10

Quellcode

1
2
txtadd(pluginname, thumb_, %1);
removeplugin(pluginname);


like that?

4

Mittwoch, 6. Juli 2011, 21:08

job1 add this to each plugin you want to disappear.

tag="thumb"

then run this action and it will work. removing_plugins(tag,thumb);

it will loop through every single plugin on the stage and only remvoe the ones with tag="thumb" i tag almost all my plugins now use this code it kind allows you to trun groups of things on and off at the same time.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<action name="removing_plugins">
		sub(i,plugin.count,1);
		if(i GE 0,removing_loop_all_plugins(get(i),%1,%2));
</action>

<action name="removing_loop_all_plugins">
		if(%2 == null,
			removeplugin(%1);
			,
			if(plugin[%1].%2 == %3,
				removeplugin(%1);
				);
			);
		dec(i);
		if(i GE 0, removing_loop_all_plugins(get(i),%2,%3) );
</action>

jpdeglet69

Fortgeschrittener

Beiträge: 215

Wohnort: France

Beruf: VR Maker and Document Management Expert

  • Nachricht senden

5

Mittwoch, 6. Juli 2011, 21:58

RE: removeplugin

Hi all, and Klaus

I try to remove plugin by lot, but it's doesn't work

eg I want to remove all the plugin photo_0, 1,2,3,4 etc..
but removeplugin(thumb_1%) not working only removeplugin(1%) works but all the plugin gone



Try %1 in place of 1% !!!

In my "engine" I use a similar code

<action name="removethumbplugin">
if(plugin[m%1t%2].created,
removeplugin(m%1b%2);
removeplugin(m%1t%2);
);
</action>
Best regards,
JPhD
VR-Guide®/Eleana CEO
https://eleana.online

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

6

Mittwoch, 6. Juli 2011, 22:39

job1 add this to each plugin you want to disappear.

tag="thumb"

then run this action and it will work. removing_plugins(tag,thumb);

it will loop through every single plugin on the stage and only remvoe the ones with tag="thumb" i tag almost all my plugins now use this code it kind allows you to trun groups of things on and off at the same time.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<action name="removing_plugins">
		sub(i,plugin.count,1);
		if(i GE 0,removing_loop_all_plugins(get(i),%1,%2));
</action>

<action name="removing_loop_all_plugins">
		if(%2 == null,
			removeplugin(%1);
			,
			if(plugin[%1].%2 == %3,
				removeplugin(%1);
				);
			);
		dec(i);
		if(i GE 0, removing_loop_all_plugins(get(i),%2,%3) );
</action>


or you upgrade it to 1.14 :D

Quellcode

1
2
3
4
5
for(set(i, plugin.count), i GE 0, sub(i), 
    if(plugin[get(i)].%2 == %3,
             removeplugin(get(i));
      );
);

Great tip about the tagging. I used to put certain strings before the the pluginname (like thumb_1, photo_1) Now Im definitely use this. Alsoo never knew that plugin[].%2 works. Thanks! Although I reckon this would be slow if you have lots of plugins (since you have to iterate m all).

7

Mittwoch, 6. Juli 2011, 22:52

@ VN2011 YESSSSSS ! ! it works like I want

@ jpdeglet69 sorry but not works

many thanks all *thumbsup*

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Job.1« (7. Juli 2011, 00:52)


jpdeglet69

Fortgeschrittener

Beiträge: 215

Wohnort: France

Beruf: VR Maker and Document Management Expert

  • Nachricht senden

8

Donnerstag, 7. Juli 2011, 07:16

@ VN2011 YESSSSSS ! ! it works like I want

@ jpdeglet69 sorry but not works

many thanks all *thumbsup*


Because I fixe a specific attribute "created" during creation
...
set(plugin[m%1b%2].created, true);
set(plugin[m%1t%2].created, true);
...
And during deletion I test this attribute
...
if(plugin[m%1t%2].created,
removeplugin(m%1b%2);
removeplugin(m%1t%2););
...
Best regards,
JPhD
VR-Guide®/Eleana CEO
https://eleana.online

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »jpdeglet69« (7. Juli 2011, 08:21)


Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

9

Donnerstag, 7. Juli 2011, 09:29

does that work?

m%1t%2?

wouldnt you need to do txtadd(tmpvar, m, %1, t, %2) ?

jpdeglet69

Fortgeschrittener

Beiträge: 215

Wohnort: France

Beruf: VR Maker and Document Management Expert

  • Nachricht senden

10

Donnerstag, 7. Juli 2011, 09:58

does that work?

m%1t%2?

wouldnt you need to do txtadd(tmpvar, m, %1, t, %2) ?


All my tours us the same main "XML engine" which read xml "data" files
where are defined all parameters for the active tour.

So this part of code, included in an action and in a loop,
creates dynamically all spots on the map (created also dynamically) of the active tour.

because for different tours I manage different maps with different number of spots...

So, it's running well, for sure... *rolleyes*
Best regards,
JPhD
VR-Guide®/Eleana CEO
https://eleana.online

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »jpdeglet69« (8. Juli 2011, 09:38)


Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

11

Donnerstag, 7. Juli 2011, 10:39

Hehe what I ment is, does this code (syntax) work for krpano?

I use similar systems where all the actions are same, but the data array you give them, is different. Thats how I can "generate" menu's, maps, galleries, hotspots.

<panoramas>
<pano name="" title="a nice location" maphotspot_x="10" category="landscapes" music="music.mp3" ref="loc1" />
etc

and then I just do a for loop, generating all the hotspots, maps, titles, menus etc based on this information. And use a tracking system, which remembers which location is active, and updates the rights title, hotspot, maphotspot, category.

but normally to generate a plugin, I use txtadd(aplugin, plugin_, %1); addplugin(aplugin); But if your syntax works, I could skip that step.