Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / FBActor and marker sets
  RSS 2.0 ATOM  

FBActor and marker sets
Rate this thread
 
9839
 
Permlink of this thread  
avatar
  • Total Posts: 23
  • Joined: 28 February 2007 07:28 PM

Hi,

I’m having the most difficult time trying to map an optical set to an actor.  Currently i create a new actor in the scene and then when i try to call

actor FBActor("newbie")
actor.MarkerSet.AddMarker(FBBodyNodeId.kFBHipsNodeIdpNode)

it states that their is no member “AddMarker” but there clearly is in the documentation. So i’m basically wondering how i tie the optical set into a marker set then apply the marker set to the actor.

any help is very appreciated,



Replies: 0
avatar

so now i have a marker set created but how do i use FBTVector within the SetMarkerTOffset function...can python access this......I keep getting “FBTVector not defined” when using the following call

markerSet.SetMarkerTOffset(FBBodyNodeId.kFBRightCollarNodeId,0,FBTVector.pTOffset)


Replies: 0
avatar

I would like to add that i know the some of the classes such as the FBTVector can be easily implemented in OR using FBVector3d* but how do i do the equivalent in python?

Thanks again,



Replies: 0
avatar
  • KxL
  • Posted: 15 March 2008 03:31 PM

I am little lazy today (after all its saturday, and in my country 8 pm), and do not want to reproduce all of your FBActor work. Can you check with FBVector4d ? BTW. You make a big mistake, becouse FBTVector is not a FBVector3d!! It’s 4d. So in your function call should look:

markerSet.SetMarkerTOffset(FBBodyNodeId.kFBRightCollarNodeId,0,FBVector4d(0,0,0,0))

Hope will work.



Replies: 0
avatar

ok, thanks.  Yeah, as you can see i’m new to this as well as programming in general. It is strange because i get this error and it refers to it as just a FBVector4 which i can’t seem to reference in python and FBVector4d doesn’t seem to be compatible.

“SetMarkerTOffset(class PYFBSDK::FBMarkerSet_Wrapper, enum FBBodyNodeId, int, FBVector4<double>*

Thanks again



Replies: 0
avatar
  • KxL
  • Posted: 16 March 2008 04:14 AM

No problem that you are learning, we all are, so sorry if I was offensive.

Back to your problem. Must say that I am missing something here, or maybe it’s lack of knowledge. Found a workaround for you by direct setting property value. Here is a code:

from pyfbsdk import FBActorFBMarkerSetFBModelMarkerFBBodyNodeIdFBVector3d

lActor 
FBActor('MyActor')
lMarkerSet FBMarkerSet('MySet')
lActor.MarkerSet lMarkerSet

lModel 
FBModelMarker('MyMarker')
lModel.Show=True
lMarkerSet
.AddMarker(FBBodyNodeId.kFBHipsNodeId,lModel)

#Can't find a way to use this...maybe someone found???
#lMarkerSet.SetMarkerTOffset(FBBodyNodeId.kFBHipsNodeId,0,_missing_FBTVector_)

#Workaround
lMarkerSet.PropertyList.Find('Hips1.TOffset').Data FBVector3d(10,10,50)


# Cleanup.
dellActorlMarkerSetlModel )
delFBActorFBMarkerSetFBModelMarkerFBBodyNodeIdFBVector3d )

Hope will help.



Replies: 0
avatar

Great thank you, but i guess i may have not explained exactly what i want to accomplish. In everyday use when i drag an optical node to an actors body node it adds it to the marker set then continues to calculate the current offset.  The current offset from the actor T-pose is what i’m trying to get, if i don’t it appears as though the actor doesn’t bind to the optical set correctly.  The workaround is great for setting the values...thanks very much.  But i would like to get the initial offset of the actor and marker set then apply it like shown in the workaround.

I tried using OR to access HFBTVector and i believe i’m missing something with the syntax.

FBVector4d* _myVec_ cannot read location
FBTVector* doesn’t exist
FBVector4d simply incompatible

Thanks again,



Replies: 0
avatar
  • KxL
  • Posted: 18 March 2008 12:09 PM

I still not sure what you want to do. Can you provide a sample scene with a steps to show me what values you want to read/write?

Also I am little confused on how you want to do this - using python or ORSDK? It is becouse there are no problems with FBTVector in ORSDK.

BTW. I saw you questions in ORSDK, what is the reason of moving to python?

Cheers



Replies: 0
avatar

I’ve also been trying to do this. I’ve managed to write a script that creates an actor and assigns existing models as markers to the Actor. It works in MB 2009, but doesn’t seem to work now in 2011.

This is the error I get:

Traceback (most recent call last):
  
File ""line 80in actorbutton1
    lMarkerSet
.AddMarker(FBBodyNodeId.kFBHipsNodeId,lModel1)
Boost.Python.ArgumentErrorPython argument types in
    FBMarkerSet
.AddMarker(FBMarkerSetFBBodyNodeIdFBModelMarker)
did not match C++ signature:
    
AddMarker(class PYFBSDK::FBMarkerSet_Wrapper {lvalue}enum ORSDK2011::FBSkeletonNodeId)
    
AddMarker(class PYFBSDK::FBMarkerSet_Wrapper {lvalue}enum ORSDK2011::FBSkeletonNodeId, class PYFBSDK::FBModel_Wrapper __ptr64)
    
AddMarker(class PYFBSDK::FBMarkerSet_Wrapper {lvalue}enum ORSDK2011::FBSkeletonNodeId, class PYFBSDK::FBModel_Wrapper __ptr64bool)

I’m not sure what has changed between 2009 and 2011 that would stop this working, but unfortunately that error means nothing to me! Any help would be much appreciated



All views/opinions expressed here are my own and do not necessarily reflect those of my company or anyone else in the world

Replies: 0