fbx python

61 views
Skip to first unread message

tomas mikulak

unread,
Feb 2, 2020, 1:26:48 PM2/2/20
to python_in...@googlegroups.com
Hi there,
Could someone help me with fbx sdk syntax,
I need to read fbx file from cmd script and query scene elements and their transforms over scene length. I managed to get list of elements but I don’t understand what is input for
EvaluateLocalTranslation(...)
FbxNode.EvaluateLocalTranslation(FbxTime pTime=FBXSDK_TIME_INFINITE,....
that is in help material of fbxNode.
I  don’t use it in maya, I just use maya to see if data are correct when queried.

Thanks,
tomas

Justin Israel

unread,
Feb 2, 2020, 5:07:31 PM2/2/20
to python_in...@googlegroups.com
I don't have access to test anything but I can try and help you to understand the API signature 


It is saying that the first argument accepts a time at which to eval the transform and defaults to a constant indicating that it should sample without animation. The docs explain the other input params in more detail. 
Did you have access to these docs or were you still unsure about it after reading? 



Thanks,
tomas

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAEUzAD0zdaLhExsKVevxTKsKs9XaE7Hu080aWdTRHJfmH8sTaw%40mail.gmail.com.

tomas mikulak

unread,
Feb 4, 2020, 9:10:54 AM2/4/20
to python_in...@googlegroups.com
Thanks Justin,
yes I have access to those papers, just the way it was written was confusing, I guess,
I need to create loop over elements and timeline to get transforms. And I haven't found how to check scene length, this is just a different way than do it on maya scene for me. 
I will keep trying .

thanks, 

tomas 


ne 2. 2. 2020 o 23:07 Justin Israel <justin...@gmail.com> napísal(a):

tomas mikulak

unread,
Feb 5, 2020, 10:13:38 AM2/5/20
to python_in...@googlegroups.com
Hi Justin,
I am loosing my nerves on this one. 
I have simple scene with jumping ball, All I need to be able to read from it is mesh list, scene in out and positions for them in time.
But I am getting out of ideas how to unwrap fbx objects I get to some useable data.
If you see it better, ot would be great

thanks

tomas


ut 4. 2. 2020 o 15:10 tomas mikulak <mikula...@gmail.com> napísal(a):
fbx_test_02.py
ball.fbx

Justin Israel

unread,
Feb 8, 2020, 3:59:12 PM2/8/20
to python_in...@googlegroups.com


On Thu, Feb 6, 2020 at 4:13 AM tomas mikulak <mikula...@gmail.com> wrote:
>
> Hi Justin,
> I am loosing my nerves on this one.
> I have simple scene with jumping ball, All I need to be able to read from it is mesh list, scene in out and positions for them in time.
> But I am getting out of ideas how to unwrap fbx objects I get to some useable data.
> If you see it better, ot would be great

If you download the python fbx SDK, it comes with a bunch of examples:
https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2019-0

In particular, "samples/ImportScene" has a very detailed example of how to read the fbx scene, look up all the objects, read the mesh data, and reach the animated properties:

$ python ./fbx2019/samples/ImportScene/ImportScene.py ./ball.fbx
File: ./ball.fbx
...
Time Mode: Frames 30 Drop
Timeline default timespan:
     Start: 1*
     Stop : 40*
...
Mesh Name: ball
    Control Points
...
Animation stack contains 1 Animation Layer(s)
AnimLayer 0
     Node Name: RootNode

     Node Name: ball

        TX
            Key Time: 1*.... Key Value: 1.17425489426 [ ? ]
            Key Time: 40*.... Key Value: 1.99647283554 [ ? ]
        TY
            Key Time: 1*.... Key Value: 4.91221523285 [ ? ]
            Key Time: 40*.... Key Value: 2.40482807159 [ ? ]
        TZ
            Key Time: 1*.... Key Value: 0.202251046896 [ ? ]
            Key Time: 40*.... Key Value: 1.26057350636 [ ? ]
...

tomas mikulak

unread,
Feb 9, 2020, 4:35:10 AM2/9/20
to python_in...@googlegroups.com
Hi Justin,
Thanks a lot. I am meantime working on opening it in maya and outputting data to json.
also from cmd mayabatch.
I will have a look on your approach and maybe I will understand how it works,

tomas

Reply all
Reply to author
Forward
0 new messages