Search - User list
Full Version: Crowd Agent shapes: Style Sheet is not picking anything up
Root » Technical Discussion » Crowd Agent shapes: Style Sheet is not picking anything up
dansidi
Hi any Crowd people out there.

I have made some crowd agents but when I try to render them, the Style Sheets are not finding any Agent Shapes.

If I ‘unpack’ my agent using the AgentUnpack node, then I can see various shapes, but all with the same agentshapename. Why is that? How can I find out the names of any Agent Shapes, if any exist?

Also, I thought that Style Sheets could pick out primitive groups using an attribute expression, like so:

@shop_materialpath = Skin

However this is not working either.
What is the syntax for this, please?

Thanks!

EDIT: Hmm, maybe this post should be titled “Crowd Agents Shapes - How Are They Made?”
cwhite
It looks like your agent has a single shape (“default.male_01”) that contains several polygon or polygon soup primitives?
I suspect you're also missing an additional level in the style hierarchy. Agent shapes are basically packed primitives, so there is a hierarchy of agent primitive -> agent shape -> primitive (e.g. polygons)
dansidi
cwhite
It looks like your agent has a single shape (“default.male_01”) that contains several polygon or polygon soup primitives?

Thanks for that.

So…..

How can I create different Agent Shapes when I make an agent?
I have tried splitting the source geometry into different pieces but then what do I do?
Attach each seperate piece as an Agent Layer? That can't be right, surely?
How is it done?

Let's say I have a mesh from an FBX.
The mesh is a single piece, however the primitives have an attribute called @shop_materialpath
I want all the primitives with @shop_materialpath = “shirt” to be one Agent Shape
and all primitives with @shop_materialpath = “skin” to be another Agent Shape, and so on.

Thanks!
cwhite
If you're importing through the Agent SOP, a shape is created from each geometry object. In the Agent Layer SOP, it depends which mode you're using - the Add Shape option in the multiparm creates a single shape from the SOP path, and the Add Shapes by Name option creates multiple shapes from the source SOP based on a name attribute.

Note that you don't really need to create separate shapes for the purposes of material assignment, and there is additional viewport overhead if you increase the number of shapes. Splitting into separate shapes mainly makes sense if you want to combine different shapes together via layers and assign those to different agents.
dansidi
cwhite
Note that you don't really need to create separate shapes for the purposes of material assignment

Thanks again.
This is good news, if true.

So, why is my Style Sheet not able to choose between the Shirt, Jeans, Skin, etc?
Is there a way to dig down into the packed agent to find those primitives which have @shop_materialpath = “Jeans” for example?
I have tried many combinations but nothing is working for me.
Please can you show me the syntax for doing that?
Thanks a lot!
dansidi
Well, by random stabs in the dark, I have found that this works, but I can't tell you why it works.

Such is often the way with Houdini…

Thanks for your help!
cwhite
That looks correct - the primitives you're trying to target are in the third level of the hierarchy (agent prim, shape, then polygons)
dansidi
Thanks for that.
My confusion come from (among other things) having used this Style Sheet thingy before when the Agent has Agent Shapes.
Now my Agent does not have Agent Shapes, so I have to dig down into the one shape I do have and pick out the Primitive Group.
Does that sound right?
cwhite
That sounds right, but it really depends on your source asset and whether its geometry was split up into multiple geometry nodes or not
dansidi
Got you.

Thanks so much for your help today.
Amit Khanna
Hey guys,

Is there a way to do this using vex/python as opposed to applying materials through data tree?

For regular assets, we set shop_materialpath to shader path through a custom Python HDA. If I have to do the same for Crowd Agents how can I access this 3 levels deep packed geometry in python so I can map my shaders to geo shapes?

I would like to leverage the existing system to apply lookdev published for the crowd agent assets if possible. Also we are not rendering with Mantra so will need to write crowds to Alembics, thus hoping I can apply my shaders through shop_materialpath.


Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB