Isotropix Forums

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

Clarisse Scripting related topics

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

Unread postby atnreg » Fri Jun 19, 2020 9:12 pm

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!
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA GTX 1080ti,Win10
Clarisse 4.0(always latest SP),Houdini,Blender,ZBrush,Fusion360,Onyx...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 595
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland

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

Unread postby sam » Fri Jun 19, 2020 9:25 pm

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
Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1649
Joined: Fri Jan 25, 2013 11:33 pm

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

Unread postby atnreg » Fri Jun 19, 2020 9:55 pm

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?
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA GTX 1080ti,Win10
Clarisse 4.0(always latest SP),Houdini,Blender,ZBrush,Fusion360,Onyx...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 595
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland

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

Unread postby atnreg » Sat Jun 20, 2020 7:15 am

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!
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA GTX 1080ti,Win10
Clarisse 4.0(always latest SP),Houdini,Blender,ZBrush,Fusion360,Onyx...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 595
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland

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

Unread postby sam » Sat Jun 20, 2020 7:24 am

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
Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1649
Joined: Fri Jan 25, 2013 11:33 pm

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

Unread postby atnreg » Sat Jun 20, 2020 7:36 am

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!
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA GTX 1080ti,Win10
Clarisse 4.0(always latest SP),Houdini,Blender,ZBrush,Fusion360,Onyx...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 595
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland

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

Unread postby abarriot » Mon Jun 22, 2020 4:01 pm

Hello,

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

Regards
Anaïs Barriot
Isotropix
Clarisse QA
User avatar
abarriot
 
Posts: 65
Joined: Mon Jun 22, 2015 8:48 am

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

Unread postby atnreg » Mon Jun 22, 2020 6:30 pm

ok. Oh, it's there already, thank you, yes now it works again :)
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA GTX 1080ti,Win10
Clarisse 4.0(always latest SP),Houdini,Blender,ZBrush,Fusion360,Onyx...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 595
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland


Return to Scripting