Jump to content

How can I get a Layer's objects with Python?


delizade

Recommended Posts

Hello,
I have 450 takes. Every take activates only one layer (make editor and render visibility true) of the document. (Other layers are disabled by default)

 

I want to modify objects that belongs to that layer which is activated by a take.

 

After getting Layer, I need to get list of objects of that Layer by Python.

 

Simply I want to make:
after I activated a take I will execute a script. That script will make some modifications about objects and their materials. After that it will updates take overrides. To make those actions I need to find Active Take > Layer > Objects

 

how can I make this? could anyone help me about this please?

 

thank you

 
Link to comment

I'd probably do it the other way round. Instead of trying to get a certain layer and finding out which objects belong to it, I'd iterate over all objects, using GetLayerObject() to check, if it belongs to the relevant layer (in the end in your case, it shouldn't matter, which layer it is specifically, as you are only interested in the visibility flags).

Link to comment
×
×
  • Create New...

Copyright Core 4D © 2023 Powered by Invision Community