Rigscript Component vs Autorig Component?

   888   5   2
User Avatar
Member
539 posts
Joined: 8月 2019
Offline
There are two rig component nodes: APEX Rigscript Component [www.sidefx.com] and APEX Autorig Component [www.sidefx.com]. They have very similar parameters. What's the difference between them? I'm still quite confused after reading the docs.
User Avatar
Member
7868 posts
Joined: 7月 2005
Offline
The APEX Autorig Component applies the component to your rig immediately. The APEX Rigscript Component instead records the components you've added into a single "recipe". And then you can apply that full recipe to your character. It's intended for more production workflows where you have built up your rig and want to apply to many characters.
User Avatar
スタッフ
78 posts
Joined: 5月 2021
Offline
The spider example in the content library uses the rigscript components and you can see it a bit more in action and there should be a few notes in there about what exactly it does and why we use it. I hope that helps
User Avatar
Member
539 posts
Joined: 8月 2019
Offline
esttri
The spider example in the content library uses the rigscript components and you can see it a bit more in action and there should be a few notes in there about what exactly it does and why we use it. I hope that helps

Thanks esttri. The spider example is very cool. It's clear why it use Rigscript Component there.

However it also raises a lot of questions regarding the function naming convention in APEX script.

For example:

main_rot = main_xform.convert_Matrix4_Matrix3_()

How could a user know this function name? How does SideFX expect us to find out this?

The example in document [www.sidefx.com]:

geo.setPrimAttribValue_String(prim, 'name', 'test')

How are we supposed to know "convert_Matrix4_Matrix3_" needs a trailing underscore, while "setPrimAttribValue_String" doesn't?
Edited by raincole - 2024年7月13日 09:33:52
User Avatar
スタッフ
78 posts
Joined: 5月 2021
Offline
The underscores are related to templates nodes in APEX aka all the nodes that look like nodename<Float> for example. Apex always wants to know on what kind of data you operate on because its a fixed type system. In apex script we can usually figure out that type based on what you are doing. If the type can not be figured out you need to give it a hint.

so
nodename_Float()
is then the same as
nodename<Float>
When you look at a graph with NODES. So the underscore is the absolute bare bone fallback option, when we really have nothing to work with to figure out what the type should be. Ideally you need to use it almost never. Another and much more pythonic way of giving a type hint is
nodename(valuetype=Float)

The daily build that is about to come out will handle a lot more of those cases automatically for you btw.
So
geo.setPrimAttribValue(prim, 'name', 'test')
should do the trick then. Yay.

The convert case is one of the few functions that actually does not just need one but 2 types. Which makes it much trickier to automatically fetch. We can look into a more specialized handing for that one. the trailing underscore is also an inconsistency that we can look into.
User Avatar
Member
539 posts
Joined: 8月 2019
Offline
Thank you for the answer. I know the underscore is about template function. My question is why one with a trailing underscore while they're both template function.

Is the rule like: if a template function takes 2 or more types, instead of 1, it needs a trailing underscore

?
  • Quick Links