Object merge not updating automatically.

   4017   6   1
User Avatar
Member
517 posts
Joined: Dec. 2013
Offline
Hi there,

I have an object merge node that works with a bunch of wildcards, this kind of thing /obj/*/OUT_Collider.
In theory it's great because I can keep adding objects with that naming convention and they will automatically be added to the object merge. The problem is they don't reliably update. Sometimes if you remove an object, it will stay in that objectmerge (for that session) and sometimes when you add a new one, it wont appear.
I heard adding this to the end might work (`substr($F,0,0)`)
Is there any way to force them to update more often? It's started to cause a few headaches as the objects in the scene aren't always reliable.

Thanks!
Pete
User Avatar
Member
676 posts
Joined: Feb. 2017
Offline
I bump this thread, cause this annoys me. too.
Would be great if object merge has a mode were it updates as soon as some of the inputs change.

Cheers
CYTE
User Avatar
Member
8513 posts
Joined: July 2007
Offline
I feel like that's unlikely at the current design
specifying objects using wildcards is not directly a dependency on anything (unlike using bundles), as it would have to resolve the wildcards constantly to find out that it needs to include or remove some other object, which may be costly as you can have wildcarded patterns on hundreds of parameters

currently it resolves the pattern when the parameter is cooked
and since it will not magically know that the pattern now resolves in different set of paths until it cooks, it will not have a need to cook to resolve it to find out if it needs to cook to resolve it, …, sort of chicken and the egg

so obviously currently you get the correct updated paths when something else forces that parameter to cook and that's why it isn't immediate

to get immediate results you can use Smart Bundles, which will resolve pattern every time the objects in the scene change and therefore it will force all parameters that use that bundle to update therefore the node will cook, …
even though bundles have their own set of workflow issues
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
517 posts
Joined: Dec. 2013
Offline
Hey thanks for the detailed response!
Yeah I can get why that would be a bit of an issue, it's a bit frustrating though when you are going through things trying to figure out why it's not working as expected

I mostly export to Unity though so I have added this to my export script,
    for node in hou.node("/").allSubChildren():
        if (node.type().name() == 'object_merge'):
            node.cook(force=True)
User Avatar
Member
676 posts
Joined: Feb. 2017
Offline
Thank you for the insight tamte!
And peteski thank you for the script. I made a custom tool containing this.
Now I can update all merges by pressing a shortcut! Great!

Cheers
CYTE
User Avatar
Member
676 posts
Joined: Feb. 2017
Offline
Hey petinksi,

the script stopped working for me. I don't know since which H version it stepped to work but I'm currently running 18.0.532.
It gives me this error:
IndentationError: ('unexpected indent', ('Update Merges', 1, 4, ‘ for node in hou.node(“/”).allSubChildren():\n’))

any idea?

Cheers
CYTE
User Avatar
Member
517 posts
Joined: Dec. 2013
Offline
Hmm not too sure but the error message seems to say the indent is incorrect. Could you paste the code here? It might just be one of those things where python expects a certain amount of spaces before each line.
  • Quick Links