Hi everyone,
Having a hard time to make python work with lop, looking especially to get a list of the camera present in scene graph tree. LopSelectionRule sounds like a good candidate for that, tried to understand better with these example[/url, especially the one that look for lights but would get errors like
AttributeError: 'LopNetwork' object has no attribute 'editableStage'
Not sure why though, would appreciate any insights [www.sidefx.com]
Python : Returning cameras in scene graph Tree
2397 3 1- adrienlambert
- Member
- 19 posts
- Joined: 12月 2018
- Offline
- robp_sidefx
- スタッフ
- 455 posts
- Joined: 6月 2020
- Offline
Hi Adrien,
Can you elaborate a bit more on the context in which you're running Python? Is it in a Python LOP? A Python pane?
If you're in a Python LOP, then `stage = node.editableStage()` should work. If you're in some other context (e.g., a Python pane), then:
1 - make sure you're trying to query the stage from a node (`/stage/some_node`) not the LOP network (`/stage`)
2 - consider `node.stage()` instead of `node.editableStage()` for querying
- Rob
Can you elaborate a bit more on the context in which you're running Python? Is it in a Python LOP? A Python pane?
If you're in a Python LOP, then `stage = node.editableStage()` should work. If you're in some other context (e.g., a Python pane), then:
1 - make sure you're trying to query the stage from a node (`/stage/some_node`) not the LOP network (`/stage`)
2 - consider `node.stage()` instead of `node.editableStage()` for querying
- Rob
- simon_o
- Member
- 112 posts
- Joined: 10月 2011
- Offline
- adrienlambert
- Member
- 19 posts
- Joined: 12月 2018
- Offline
-
- Quick Links