Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

81

Sonntag, 19. Februar 2023, 17:04

Quoted from "s-maier"
However I notice some big diffrence: The Scrollarea even displays the scrollbars when there is nothing to scroll.
This is very counter intuitive and kinda annoying.

I assume you mean the new autoscrollbars feature - that's only for automatic controlling and sizing the scrollbars, but they will not change the layout of the scrollarea or other layers.

For checking if scrollbars are required, the onoverflowchange event and the woverflow / hoverflow variables can be used. When the values are greater than 0, then the content is overflowing and a scrollbar would be required.

Source code

1



onoverflowchange="if(hoverflow GT 0, show the scrollbar, adjust the layout..., hide the scrollbar... );"



Oh brilliant, I didn't see the "onoverflowchange" and worked on a much more complicated solution. Thanks!

82

Montag, 20. Februar 2023, 14:30

Hello Klaus,

in 1.21 the string '*' as action parameter is passed as null.

Quellcode

1
2
3
4
<action name="test" scope="local" args="arg1">
   trace(%1, " - ", get(arg1));
</action>
test('*');


results in "INFO: null - null"

Not a great problem, but one has to know it.

Wolfgang

83

Mittwoch, 22. Februar 2023, 10:17

Hi,

in 1.21 the string '*' as action parameter is passed as null.

That's due the new *var syntax support for resolving the variable content:

Zitat

New: Instead of get(var) it is now also possible to use just *var to resolve a variable to its value. Can be used when passing a variable to an action or as an array index.

Additionally: 'historically' the string quotes were resolved 'before' doing the get/calc/*/() resolving , so the quotes weren't bypassing that parsing step. For the next release I have tried now moving the string-quote resolving 'after' the get/calc resolving. This should solve this problem and would be generally a better behavior, but I will need to check for potential compatibility problems with this change.

Best regards,
Klaus

84

Mittwoch, 22. Februar 2023, 18:12

Zitat

the new *var syntax


nice :) like a C pointer *smile*

85

Donnerstag, 23. Februar 2023, 18:09

Resize layer and its children

Hi Klaus,
I have an issue with the resizing of layer and its children.
With previous version I used this code (that, if I remember well, you provided) :

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<events name="bg_scale_map" onresize="bg_automatic_fit_inside(map);" />
<action name="bg_automatic_fit_inside">         
     if(layer[%1].loaded,            
        div(screenaspect, stagewidth, stageheight);            
        div(imageaspect, layer[%1].imagewidth, layer[%1].imageheight);
        if(imageaspect GT screenaspect,                
            if (device.mobile,
                set(layer[%1].width,90%);
                set(layer[%1].height,prop);
            ,
                set(layer[%1].width,80%); 
                set(layer[%1].height,prop);
             );
       ,
        if (device.mobile,
            set(layer[%1].width,prop); set(layer[%1].height,90%);
         ,
            set(layer[%1].width,prop); set(layer[%1].height,80%);
          );
      );
);
</action>


With version 1.21, the layer is resizing well but the children layers have a position shift(I tried this code in the example of winecellar, when resizing there are the position of the three mapspots is shifting).

I have a feeling that it happens because of the decorrelation of the scale and layer dimensions but I didn't find a solution to make this worked correctly.
If anyone has a clue I'm interested !
Thanks !
Tristan

86

Freitag, 24. Februar 2023, 10:30

Hi,

I have a feeling that it happens because of the decorrelation of the scale and layer dimensions but I didn't find a solution to make this worked correctly.
Right, its the same as here - size and scale are decoupled now...

Here an alternative solution:

Quellcode

1
2
3
4
5
6
7
<action name="bg_automatic_fit_inside">         
  callwith(layer[%1],
    if(loaded,
      scale = 0.9 * min(stagewidth/sourcewidth, stageheight/sourceheight);
    );
  );
</action>
The 0.9 maps to the 90% in the old example - so the image covers max. 90% of the width or height depending on the screen and image aspect. It's even simpler because no "prop" would need to be used. And an animation by tweening the scale would be possible...

Best regards,
Klaus

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

87

Freitag, 24. Februar 2023, 11:23

Combobox issue

Hi,
I have a issue with the combobox 1.21
The text item is offset depending on item position in the list : https://360images.fr/barebone_combobox_1.21/combobox.webm
You can test it here : https://360images.fr/barebone_combobox_1.21/
I have no issue when testing with 1.20.11
I have a tour with 40 items in the list and it can scroll between 2 items instead of scrolling to the clicked item ?
A clue ?

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »jeromebg« (24. Februar 2023, 11:36)


88

Freitag, 24. Februar 2023, 11:56

Calling loadscene from within a localonly action

Hi Klaus,

I noticed a strange behavior when calling "loadscene" inside an action with its scope argument set to "localonly". This action code will only load the preview image of the new scene (plus its hotspots etc., but the pano will stay blurry):

Quellcode

1
2
3
<action name="change_scene" scope="localonly" args="new_scene">
    loadscene(get(new_scene));
</action>


When I change the actions scope to "local" the full pano image gets loaded as expected:

Quellcode

1
2
3
<action name="change_scene" scope="local" args="new_scene">
    loadscene(get(new_scene));
</action>


My guess would be that the "loadscene" action inherits the scope from my action, but doesn't use the global object to access certain variables and fails silently. This might be related to this change from the release notes:

Zitat

Fix: When a loadpano/scene/xml action was called from a localscope action, the xml parsing could wrongly write some parsing results into the localscope.


Is this behavior intentional?

Kind regards
Christian

89

Freitag, 24. Februar 2023, 13:54

I noticed a strange behavior when calling "loadscene" inside an action with its scope argument set to "localonly". This action code will only load the preview image of the new scene (plus its hotspots etc., but the pano will stay blurry):

Sorry, I can't reproduce this...
Do you use version 1.21?

90

Freitag, 24. Februar 2023, 15:16

I noticed a strange behavior when calling "loadscene" inside an action with its scope argument set to "localonly". This action code will only load the preview image of the new scene (plus its hotspots etc., but the pano will stay blurry):

Sorry, I can't reproduce this...
Do you use version 1.21?


Hi Klaus,

yes, I use version 1.21. After some more testing I have now isolated a test case, please see [redacted] (view-source:[redacted])

Executing this command via the console will only display the blurry preview image:

Quellcode

1
krpano.call('change_scene_localonly("scene1");');


This command works as expected:

Quellcode

1
krpano.call('change_scene_local("scene1");');


"scene1" is from an older project that I tried to upgrade to krpano 1.21 and it looks like this:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<scene name="scene1" title="scene1" onstart="" havevrimage.mobilevr="false" havevrimage.no-mobilevr="true" thumburl="panos/scene1.tiles/thumb.jpg" lat="" lng="" alt="" heading="">
		
	<control bouncinglimits="calc:image.cube ? true : false" />

	<view hlookat="0.0" vlookat="0.0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />

	<preview url="panos/scene1.tiles/preview.jpg" />

	<image type="CUBE" multires="true" tilesize="512" if="!webvr.isenabled">
		<level tiledimagewidth="4224" tiledimageheight="4224">
			<cube url="panos/scene1.tiles/%s/l3/%0v/l3_%s_%0v_%0h.jpg" />
		</level>
		<level tiledimagewidth="2112" tiledimageheight="2112">
			<cube url="panos/scene1.tiles/%s/l2/%0v/l2_%s_%0v_%0h.jpg" />
		</level>
		<level tiledimagewidth="1024" tiledimageheight="1024">
			<cube url="panos/scene1.tiles/%s/l1/%0v/l1_%s_%0v_%0h.jpg" />
		</level>
	</image>
</scene>


I also added a "scene2" to the test case that works as expected with both actions ("local" and "localonly"). This is a newly created scene using the krpano tools 1.21.:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<scene name="scene2" title="scene2" onstart="" havevrimage.mobilevr="false" havevrimage.no-mobilevr="true" thumburl="panos/scene2.tiles/thumb.jpg" lat="" lng="" alt="" heading="">
		
	<control bouncinglimits="calc:image.cube ? true : false" />

	<view hlookat="0.0" vlookat="0.0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />

	<preview url="panos/scene2.tiles/preview.jpg" />

	<image if="!(webvr.isenabled OR device.mobilevr)">
		<cube url="panos/scene2.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,1024,2112,4224" />
	</image>

	<image if="webvr.isenabled OR device.mobilevr">
		<cube url="panos/scene2.tiles/vr/pano_%s.jpg" />
	</image>

</scene>


So I guess this has something to do with backwards compatibility. Not sure, what your policy is in this case, as krpano 1.21 is expected to break some things anyway and we might need to simply regenerate all scenes when upgrading older projects.

Kind regards
Christian

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »ctt360« (1. März 2023, 10:52)


91

Freitag, 24. Februar 2023, 15:42

Indeed it's even easier ! Thanks Klaus !

92

Freitag, 24. Februar 2023, 16:12

So I guess this has something to do with backwards compatibility. Not sure, what your policy is in this case, as krpano 1.21 is expected to break some things anyway and we might need to simply regenerate all scenes when upgrading older projects.

Thanks - that example helped - the problem/bug was related to the <level> usage.
This will be fixed in the next release.

About compatibility / policy - the main idea is to be as compatible as possible and do breaking changes only when not avoidable or the balance between being compatible and improve is more on the improve side...

milotimbol

Fortgeschrittener

Beiträge: 242

Wohnort: Philippines

Beruf: Software Developer

  • Nachricht senden

93

Samstag, 25. Februar 2023, 03:27

Dynamic Scrollarea height

Question about scrollarea

I got the code here and put it inside a sidebar
https://krpano.com/releases/1.21/viewer/…grid-layout.xml

The middle part I used the code chunk here
https://krpano.com/viewsource.html?relea…rea-infobox.xml

See attached screenshot


According to the docs "The scrollarea plugin needs to have a defined size and aligment and can be used only as children layer inside an other layer element."

So On a resize event I try to compute / set the height of the middle section however when I try to get the heights of the header footer they're all null. How do set a height to the scrollarea parent in this case?

94

Samstag, 25. Februar 2023, 08:34

there was/is the (textfield) onautosized event which is called when the layer gets its size.
but it is missing now in the 1.21 documentation...
@klaus: how do we do that in 1.21?

95

Samstag, 25. Februar 2023, 09:06

Question about scrollarea
Please post your example (in a separate thread).

there was/is the (textfield) onautosized event which is called when the layer gets its size.
but it is missing now in the 1.21 documentation...
@klaus: how do we do that in 1.21?

There is a new onresize event.
It works for all layers, not just textfields.
It is basically the same as the onautosized event (which is still supported for compatibility).

96

Samstag, 25. Februar 2023, 09:28

Right mouse button action in krpano 1.21

Klaus mentioned here that from version 1.21 it will be possible to assign any actions and events to the right mouse button.
I can’t figure out how to attach an action to the right mouse button press event, for example,
zooming by a certain amount when pressed and zoomingout when the right mouse button is released.
Has anyone already figured this out?

kme

Fortgeschrittener

Beiträge: 310

Wohnort: Belgium

Beruf: Long time coder, product manager and 3D enthousiast

  • Nachricht senden

97

Samstag, 25. Februar 2023, 10:36

Klaus mentioned here that from version 1.21 it will be possible to assign any actions and events to the right mouse button.
I can’t figure out how to attach an action to the right mouse button press event, for example,
zooming by a certain amount when pressed and zoomingout when the right mouse button is released.
Has anyone already figured this out?


Something like this?

Quellcode

1
2
3
4
5
6
7
8
<events ondown="copy(orgfov, view.fov); 
				asyncloop(mouse.rightbutton, 
					  mousemovey = calc(mouse.downy - mouse.y);
					  set(newfov, calc(orgfov-calc(roundval(mousemovey/10, 2))));
					  set(view.fov, get(newfov));			  				  
                );" />
				
<events onup="if (mouse.button==2, tween(view.fov, get(orgfov), 0.2);)" />


See it here: https://krpano.kri-soft.be/examples/rightclickzoom/

Edit: I noticed i simply did a zoom in/out, will see to have it "reset" after releasing the right click

Edit: done - code and example updated...

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »kme« (25. Februar 2023, 10:50)


kme

Fortgeschrittener

Beiträge: 310

Wohnort: Belgium

Beruf: Long time coder, product manager and 3D enthousiast

  • Nachricht senden

98

Samstag, 25. Februar 2023, 11:01

I also tried the following code:

Quellcode

1
2
3
<events ondown="if (mouse.button==2, copy(orgfov, view.fov); tween(view.fov, get(calc(orgfov-30)), 0.2);)" />
				
<events onup="if (mouse.button==2, tween(view.fov, get(orgfov), 0.2);)" />


But in this case, the krpano menu still pops up if you don't move the mouse (which I think is intentional and cannot be disabled).

99

Sonntag, 26. Februar 2023, 05:19

I also tried the following code:

Quellcode

1

				


But in this case, the krpano menu still pops up if you don't move the mouse (which I think is intentional and cannot be disabled).
Brilliant my friend! Thank you very much for the hint, for this piece of code,
for the sensible feedback. The second version is closer in meaning to what I wanted to implement.
We can see this functionality in many games and this is quite an intuitive action, in addition,
it can be provided with sound and additional overlays on the screen as in the game HALO Infinite ,
and hotspots can also be highlighted in this mode, like the scan or vision modes of the Witcher.
I would really like to somehow signal to Klaus that this is a very cool and cheap effect
that could be implemented in many places. Of course, the context menu on the right key is also
a very important and useful thing, but maybe move it to another hot key? What are your thoughts on this?

kme

Fortgeschrittener

Beiträge: 310

Wohnort: Belgium

Beruf: Long time coder, product manager and 3D enthousiast

  • Nachricht senden

100

Sonntag, 26. Februar 2023, 11:20

onup not called

I think I found a bug, or at least some side behavior I don't like.
It's case where the onup is not triggered.

With this code:

Quellcode

1
2
3
<events ondown="if (mouse.button==2, copy(orgfov, view.fov); tween(view.fov, get(calc(orgfov-30)), 0.2);)" />
				
<events onup="if (mouse.button==2, tween(view.fov, get(orgfov), 0.2);)" />


Do the following:

Normal behavior:
- richt click and hold in the panorama: the view is zoomed in
- release right click: the view is zoomed to its original state

Bugged behavior:
- right click and hold in the panorama: the view is zoomed in
- while HOLDING the right click still active, do a LEFT click: you can drag around in the pano while zoomed in
- release the left click
- release the right click: the onup event is not called and the zoom level is not reset to its original state

In general, the onup() event is not called while the left mouse button is used in between the ondown and onup of the right mouse.

Also, same behavior with my previous right mouse click zoom drag example above.

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »kme« (26. Februar 2023, 11:33)


Ähnliche Themen