|
So I’m trying to build a script that does some smart, automatic plotting. Here’s the setup:
- there is a setup file that can contain anywhere from 1-6 characters (using custom char->char solve, not actor->char solver)
- .c3d data is imported into the setup file, so you could potentially have 1-150 takes
- we need to plot TR on various bones and only R on others. The bones all have the same name and are differentiated with namespaces
So algorithmically it’s not that difficult to put together, but I’m having problems with the “smart” portion of the script (how ironic):
Since I’m trying to make a generic script that can run on any setup file, it doesn’t make sense to plot data on a bone that doesn’t need it
For example, since we’re using namespaces to separate out the various characters, you could have ply1:root, ply2:root, ply3:root, etc. The thing is, we don’t know how many characters are in a setup file. What’s worse, there is no consistency between the # of characters and the “namespace number”. Thus, we could have 4 guys in the scene and they could be named “ply1:root, ply2:root, ply5:root, ply19:root”.
The “smart” portion of the script would check to see if the root node has a global translation value that changes over time; if it does, the character has data that needs to get plotted. If not, there’s no mocap data driving the character so we don’t need to plot him.
I can’t seem to iterate over items that start with “ply” (the namespace name), so I’m not sure how I can go about this. Meaning, how can I find all the ply*:root in the scene? Ideally, I’d want to do something like:
for every matching item named ply*:root:
if you have data
plot it
Any suggestions?
|