Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

How to check if an render setup layer override is applied to object X?

How to check if an render setup layer override is applied to object X?

h.schoenberger
Enthusiast Enthusiast
638 Views
1 Reply
Message 1 of 2

How to check if an render setup layer override is applied to object X?

h.schoenberger
Enthusiast
Enthusiast

Hi

 

I need to parse all layers and check if an attribute of some objects is set-

As layer overrides can change these values, I need to parse all layers if the override is applied.

So far I have this code to get a list of overrides of all layers:

 

rs = renderSetup.instance()
rLayers = rs.getRenderLayers()

for layer in rLayers:

    colList= layer.getCollections()
    for col in colList:
        overrides=col.getOverrides()

        for oride in overrides:

            print("override applied to attribute "+oride.attributeName())

 

 

 

But now I need to know if my object is in that layer collection.

 

I know from the UI interface that you can add objects by its absolute name or by a filter like  *myobj*.

But how do I get this information via script?

 

 

0 Likes
639 Views
1 Reply
Reply (1)
Message 2 of 2

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

For testing if the object is in a layer you could try renderLayerMembers command like below:

 

renderLayerMembers "myCylinder" -notIn true -renderLayers "MyRenderSetupLayer"

 

For collections in renderLayer, I am afraid you'll need to test them yourself. You could get a collection's selector with col.getSelector().

 

A simpleSelector could get its selection with selection() and it has an iterator path.

 

Yours,

Li

0 Likes