Page 1 of 1

How to use the new LayerScene? (to get layer camera)

Unread postPosted: Fri Jun 19, 2020 9:12 pm
by atnreg
Hi!
SP7 release note says:
"Added the LayerScene class to the Object Framework from which the Layer3d class now derives. It defines attributes and methods that allows to manipulate a 3D scene (camera, group of geometries, group of lights)."

How to use that?
I have tried everything I can think of but always end up in "'ModuleLayer3d' object has no attribute 'get_camera'".

Here is one of many variations, same result:
Code: Select all
imageitem=ix.get_item("project://scene/render") # any Image item
imgmodule=imageitem.get_module()
layers=imgmodule.get_layers()
layer0=layers[0] # let's use the first layer
layerobj=layer0.get_object()
print layerobj # --> project://scene/render.background
layermod=layerobj.get_module()
print layermod # --> <framework.ModuleLayer3d; proxy of <Swig Object of type 'ModuleLayer3d *' at 0x000001B6FD141C30> >
cam=layermod.get_camera()
--> AttributeError: 'ModuleLayer3d' object has no attribute 'get_camera'


What am I doing wrong? The SDK doc lists the get_camera() as member of ModuleLayer3d:
file:///C:/Program Files/Isotropix/Clarisse iFX 4.0 SP7/Clarisse/docs/common/sdk/class_module_layer3d-members.html

Please help :)

Thank you!

Re: How to use the new LayerScene? (to get layer camera)

Unread postPosted: Fri Jun 19, 2020 9:25 pm
by sam
Hi,

The LayerScene is only an abstract class to simplify 3rd party renderer integration to Clarisse. Nothing more than internal code management to improve the API. Nothing to see here

Re: How to use the new LayerScene? (to get layer camera)

Unread postPosted: Fri Jun 19, 2020 9:55 pm
by atnreg
Ok but then why the get_camera() method is not found on ModuleLayer3d?
It worked fine in SP6b so something must have changed, how to use it now?

Re: How to use the new LayerScene? (to get layer camera)

Unread postPosted: Sat Jun 20, 2020 7:15 am
by atnreg
The code above works perfectly in SP6b but according to docs it should also still work the same in SP7 (get_camera is inherited public member of ModuleLayer3d) but it does not.
What do I need to change to get it to work again?

Please someone help!

Re: How to use the new LayerScene? (to get layer camera)

Unread postPosted: Sat Jun 20, 2020 7:24 am
by sam
Hi Antti,

You might have found a bug but this is the weekend so you won't likely get an answer before Monday. I also assume this is not showstopper since you can still use SP6b.

Just a little patience until we sort that out.

Thanks

Re: How to use the new LayerScene? (to get layer camera)

Unread postPosted: Sat Jun 20, 2020 7:36 am
by atnreg
Hi!

Sam, thank you for your reply, I posted this message before noticing your reply (you posted while I was writing :)) so I modified this to be just more info about the problem. And yes it's weekend and this is not showstopper and now that I know it may be bug, I will not waste more time on it, I'll wait for Monday :)

I modified the code a bit and it reveals clearly that there is big change in something:
Code: Select all
print "-------------------"
imageitem=ix.get_item("project://scene/render") # any Image item
imgmodule=imageitem.get_module()
layers=imgmodule.get_layers()
layer0=layers[0] # let's use the first layer
layerobj=layer0.get_object()
print layerobj # --> project://scene/render.background
layermod=layerobj.get_module()
print layermod # --> <framework.ModuleLayer3d; proxy of <Swig Object of type 'ModuleLayer3d *' at 0x000001B6FD141C30> >
print "attributes:",len(dir(layermod))
test=getattr(layermod,'get_camera','no such attr')
print test


In SP6b this prints:
project://scene/render.background
<framework.ModuleLayer3d; proxy of <Swig Object of type 'ModuleLayer3d *' at 0x000001B16A6F7840> >
attributes: 195
<bound method ModuleLayer3d.get_camera of <framework.ModuleLayer3d; proxy of <Swig Object of type 'ModuleLayer3d *' at 0x000001B16A6F7840> >>

But in SP7 this prints:
project://scene/render.background
<framework.ModuleLayer3d; proxy of <Swig Object of type 'ModuleLayer3d *' at 0x000002C960ED0B70> >
attributes: 81
no such attr

NOTE: In SP6b there are 195 attributes in ModuleLayer3d but in SP7 only 81!!!!!!

I hope this helps you to find the solution, see you hopefully on Monday or soon anyway :D

Thank you!

Re: How to use the new LayerScene? (to get layer camera)

Unread postPosted: Mon Jun 22, 2020 4:01 pm
by abarriot
Hello,

We have fixed the issue in Clarisse 4.0 SP7b.
Thanks,

Regards

Re: How to use the new LayerScene? (to get layer camera)

Unread postPosted: Mon Jun 22, 2020 6:30 pm
by atnreg
ok. Oh, it's there already, thank you, yes now it works again :)