Looking for python command work-around for Update Layer Membership bug

Looking for python command work-around for Update Layer Membership bug

Anonymous
Not applicable
716 Views
1 Reply
Message 1 of 2

Looking for python command work-around for Update Layer Membership bug

Anonymous
Not applicable

In Maya 2018.6, there seems to be a bug where membership of a layer collection will not update unless the user toggles the "collection filters" type back and forth. A very simple example is this. (Using the Render Setup window)

1. Create a new layer

2. Create a new collection.

3. Collection Filters = Transforms, Include = pS*2

4. Create a polysphere (pSphere1 by default)

5. Rename pSphere1 to pSphere2.

Now hit "Select All" in the collection. It does not select pSphere2! And there is nothing "normal" that you can do about it. The eyeball icon does not have a red border, so you cannot easily force the layer to update it's layer membership (I'm looking for python command that does that). All you can do is toggle the Collection Filters from "Transforms" to something else and then back to "Transforms" again. This wakes up the membership and now "Select All" will select pSphere2 as it should.

 

I'm assuming this bug has been reported, but either way, I would like a sane work-around for this bug. Is there a python command that wakes up a layer and tells it to refresh it's membership?

 

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

Anonymous
Not applicable

man... I'd really love a reply to this. I'm trying to embrace the new Render Setup system, but my company is saying that we have to use legacy layers. They're saying that Autodesk rushed to depreciate legacy layers before working out critical kinks in the new Render Setup system. This bug is certainly evidence of that. It is very easy to to work under the radar of the collection expressions. All I need is a command that tells a layer to re-evaluate it's membership, especially in the case of expressions. I can easily create new nodes or rename nodes or move nodes so that they should be collected with an existing collection expression. However, the collection will ignore those nodes until I fiddle the "collection filters" dropdown back and forth as a hack. When I do that, the expression re-evaluates the membership of the collection and now includes those new nodes and re-named nodes. 

 

I can't make an argument to my company that Render Setup is production ready if it's returning inaccurate (not up-to-date) collections. My artists will do work, the layers will not recognize that work, and my artists will have no way of smacking the layers to "wake up" and pick up my changes. "Please re-evaluate! I created a new node! This expression should be picking it up. Why isn't it picking up my new node?" Or worse, they might not realize that Maya isn't picking up the changes. I'm literally building a script called "Poke the Layer" that walks through all of the cell statements in a layer and toggles their collection filter (node type) back and forth so that expressions will re-evaluate and pick up new, moved, and renamed nodes.

0 Likes