|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| duplicate hierarchy and relationconstraint them
|
|
|
sooo.... a whole bunch of questions. Some of them probably easy for you guys ;-)
I have a skeleton, and need to have it drive an “Export” skeleton. I could probably make it work with what I have, but it would be a novel of a script ;-)
What I basically need is a way of copying a bone hierarchy, and add a namespace to the new one.
I can copy all the bones, but they don’t stay in a hierarchy.
It also renames the bones, even when a namespace is added.
Normally when I do that manually it adds a “1” in the namespace and not the bone. Why is it not working the same way when scripted?
After that is done, I need to have the original bones to drive the “Export” skeleton.
I have created the relation-constraint and managed to connect two boxes, but I need a way to have it do that for all the bones in the hierarchy.
I’m still quite new at all this, so any help is appreciated.
Thanks
|
|
|
|
Sooo.... I got the duplicate working. Here it is if anyone has the same problem. I anyone has an easier way I would love to see it.
from pyfbsdk import *
def Clone (lModel):
lClone = FBModelSkeleton ("Temp") ### creates model
lClone.Show = True
lClone.Color = FBColor (1,0,0)
lClone.ProcessObjectNamespace(FBNamespaceAction.kFBConcatNamespace, "namespace", "", False) ### gives model a namespace and gets org name
lClone.Name = lModel.Name
lParent = lModel.Parent
if lParent == None: ###Checks for parents
None
else:
lParentName = lParent.Name ### Finds "namespace" parent from the org skeleton
cl = FBComponentList()
lObj = FBFindObjectsByNamespace( "namespace", cl ) ### Looks for all "namespace" objects
for lObj in cl:
if lObj.Name == lParentName: ### If "namespace"name matches org parent name then find same clones objects and parent
foundlObj = FBFindModelByName (lObj.LongName)
lClone.Parent = foundlObj
lVector = FBVector3d () ### copies the pos and rot
lModel.GetVector ( lVector, FBModelTransformationMatrix.kModelTranslation, False, None)
lClone.SetVector ( lVector, FBModelTransformationMatrix.kModelTranslation, False, None)
lModel.GetVector ( lVector, FBModelTransformationMatrix.kModelRotation, False, None)
lClone.SetVector ( lVector, FBModelTransformationMatrix.kModelRotation, False, None)
lchild = lModel.Children
for child in lchild:
Clone (child)
Clone (FBFindModelByName ("Root"))
What i need now is to find a way to connect the translation and rotation of the two skeletons in a Relations constraint. I’ll post if I find a way.
|
|
|
|
Sooo, I’ve figured out everything except connecting the boxes in the relation constraint.
I have a bunch of boxes with a name, and the same ones with a namespace. And I need to connect the translation and rotation.
so, sender “spine” sends translation and rotation to receiver “Namespace:spine”
Any way of getting that working???
Thanks in advance
|
|
|
|
| Settings
| Choose Theme color:
|
|
|
|
|
|
|
|
|