Showing posts with label mantra. Show all posts
Showing posts with label mantra. Show all posts

Tuesday, 21 January 2025

stylesheets for crowd agents and mantra

To view stylesheets, make a new network view -

 Inspectors>DataTree, then click Choose a Viewer, Material Stylesheet


Firstly you (I) should know that stylesheets only really work with Mantra (they might work with Redshift).... The crowd object has a material attached to it at object level, so everything is one shader and each sub object is going to get overrides using stylesheet magic.

if you right click on the "style sheet parameter" you can Add a Style. I've renamed them to the various parts-  tophat, mainMat1 etc.

Then you right click those and create Overrides and Targets. The hats, props (anything not part of the main agent) are a few levels in, so you need to add a sub target, then a condition, which is then set to Agent Shape. I've added the value "hat" to specify that prop. In the override I've got it set to "Set Material", then i specify the material I want.

To override the main agent skin, you do a similar thing, only the name of it is "default.skin". In the example I am doing a material parameter override instead of a complete material swap. I'm also using a condition at the primitive level, checking for a couple of point attributes I added at SOP level. This override only gets applied if @randVal is zero and if @randSkinVal is greater than 0.4

That's kind of it, for stylesheets! It's crazy magic, but also not as scary as I thought.