Thursday, 23 January 2025

Karma per light aov

per light AOV stuff with Karma.

In your light, in the Karma tab, add a name to the LPE Tag. Here I've typed "A".

On the right hand side of all the AOV bits, you can tick Split per LPE Tag - ON EVERYTHING




Wednesday, 22 January 2025

skinned geo as agent layers for crowds/fbx

A brief how-to-add-proper-skinned-geo to a crowd agent..
Get the Rest Pose (T pose) of the agent. (You can just use a skeleton if you have one, and then use "Agent From Rig" to turn it into an agent.)
Put your desired geometry (the red trouser leg in the screenshot) into position.
Joint Capture Biharmonic it! This is how you skin stuff with kinefx.
You can preview the deformation with a RigPose and Bone Deform sop.

Give the skinned geo a name attribute (string on primitive).
Add it as a shape on an agent layer as you do with props. Note that the skinned stuff should not be packed. I don't know why, but you can merge it along with the packed rigid props & the Agent Layer node will pick up the name attribs.

crowds in solaris/karma

 Bring in crowd from obj using SOP Crowd Import node (here it's still packed agents). Create Instanced SkelRoots is preferred I think


Stylesheets don't work with Karma/Solaris (as far as I know!) To target props/shapes in a crowd you're best off using Collections. Here we're making collections of the hammer prop. 
It's important to tick Allow Instance Proxies in Collection!
The syntax is %reference:/path
In the example it's %reference:/crowd/agentdefinitions/ball/shapelibrary/l_hammer


Here's the stage scene outliner thing

Assign the materials to the collection by typing in the name. Eg. %hammer

Be sure to expand the Material Binding and tick Include Descendant Primitives in Collection
You might have to change the Strength to Stronger or Weaker than Descendants too.


I couldn't see a good way to access point attributes (eg. per agent float/int values) but Material X does read them - so I guess use switch RGB and stuff like that?
This seems to be the user data equivalent-

This seems to be the best switch RGB equivalent-

Just plug em in like this - just like Arnold

And ta da...attributes and collections targeting different bits of a crowd!




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.









multi layers and props agents more info!

Bit of new info I learnt from this handy video https://www.youtube.com/watch?v=CVMu-6sRqvY
I was finding I couldn't layer my props previously. So I'd only be able to have a "hat" or a "sword" agent, but couldn't seem to combine them, despite their bindings being separate. The answer *seems* to be this.... bind all possible shapes! here's how we do it.

1 - use agent animation unpack to get a bind pose. I then timeshift it to frame 1 (you might use 1001) to remove time dependency

2- get all your geo and transform them to where you need them. Eg. sword at left hand, hat at the head positions

3- mergepack them all, and give them appropriate names

4- capturepacked geo, specifying each named packed prim + joint to capture to

5 - now in the agent layer you can specify multiple props/shapes and group them up.
 - note you no longer have to specify the joint in this node, as the props have bindings already
-remember to assign to default













Monday, 20 January 2025

retarget animation clip from one rig to another + use within agent setup

 

This is the general layout for retargeting one rig's animation to another.

you can also add multiple retargeted clips to the agent clip sop by Packing the Inputs in the Motionclip sop. Then in the agentclip sop there is a "treat packed primitives as inputs" tick box, that you'll need to tick. Also the clips need to be "named", use a "configureclipinfo" to add a clip name.

Above in the screenshot, there is a jointdeform sop - it is only needed to preview the animation on the target character. Also, I had to bring in the fbx of the default pose of the target character, I couldn't figure out a way to access the skeleton directly from the agent sop. Maybe unpacking? Also the timeblend is potentially unnecessary, I had it there to force some subframes.

UPDATE - 
Just an update of the setup! In the rigmatchpose, I move the SOURCE skeleton around to match the target skeleton, as best i can. This is all done on frame 1 at the T pose. I then blend into the animation at >frame 1 with the skeleton blend.

Using the configureclipinfo node, we can specify the looping clip range eg(2 - end)



And then you can put several clips into the motionclip sop as packed clips nicely.





agent layer props

Instead of using that script to transfer from object to world space, it can be easier to do this. Position them against one of your clips and then specify them in the layer sop - in my case I used the default T pose clip, which in all honesty will probably your best option.
It seems like you will have to do a separate agent layer sop per joint/transform that you are adding to, eg- one for the head, one for the wrist etc.