Solaris Crowd import, agent definitions issue

   692   2   1
User Avatar
Member
52 posts
Joined: June 2016
Offline
Hello everyone,

I'm working on crowds right now.
I've noticed an issue when importing crowd simulation from "/obj/" context to Solaris.

The crowd sop import node and the sopimport node give me the same result.

Sometimes, when we do post-process on crowd simulation (splitting parts of the crowd, doing some stuff, retiming part of it), when we merge back the entire crowd, I have problems with agent definition into Solaris.

I have kind of broken definitions and duplicates definitions, and I don't know how to fix this, except by splitting all the parts and merge them with multiple sopimport.

For example :
here is a standard behavior when importing a crowd from OBJ context

-> As you can see, the agentdefinition has been imported properly : one single agent definition for all agents

here is what I get when I try to split / For Loop / Timeshift parts of the simulated crowd, and merge back everything :

-> I have in the agentdefinitions, several definitions.

The result of this, is that all rendering are incorrect : some agents are not properly loaded, and don't appear.

I was wondering if someone already have this issue, and how to fix this.
By the way, I've tried to read in python the agent primitive shapeLibrary, to see if something went wrong, but they all have the same path. But in solaris... it create lots of definition...

Maybe there's a trick to clean up definition before importing in Solaris.

On last thing : as soon as I do Timeshift node on part of my simulated crowd and merge it back, this issue appear... I don't have solution for this.


Info : I'm on Houdini 19.5.493.

Thank you all and best wishes !

Attachments:
2023-12-27 172931.jpg (23.3 KB)
2023-12-27 172827.jpg (54.9 KB)

User Avatar
Member
52 posts
Joined: June 2016
Offline
I finally found a solution to fix the problem.

I started to check with python each agent definition, which returns me always the same path (with hou.AgentDefinition.shapeLibrary(), and .rig()), but it seems that internally something went wrong while switching to Solaris (this is why I got buggy agent definition in the scene tree).

So what I did is :
- looping through each agentname, and re-apply the same agent definition in python using my agent source.


The code i'm using is :
node = hou.pwd()
input1 = node.inputs()[1]
ref_agent_geo = input1.geometry()
current_geo = node.geometry()

ref_agent_def = ref_agent_geo.prims()[0].definition()
ref_agent_def = ref_agent_def.freeze()
#print(ref_agent_def)

for agent in current_geo.prims():
    agent_def = agent.definition()
    new_def = agent.setDefinition(ref_agent_def)

Now, the import in Solaris is proper and clean.

Hope this will help

Attachments:
solution1.jpg (39.1 KB)

User Avatar
Staff
727 posts
Joined: Oct. 2012
Offline
FYI, comparing the hou.AgentDefinition's is the correct way to see if you have somehow created multiple unique agent definitions. Individual pieces like the rig and shape library can potentially be shared across agent definitions, e.g. if you have a new version of an agent definition which just contains some new clips
  • Quick Links