Isotropix Forums

Get Kinematics Information

General Discussion about Isotropix and CG related topics

Get Kinematics Information

Unread postby tdsj4571 » Mon Jul 22, 2019 2:53 am

Hi,

I have an issue of getting kinematics information here.
I tried to solve it by the link.
( viewtopic.php?f=21&t=3504&p=14395&hilit=rotation#p14395 )
But I got different translate and rotation values from the data in Maya(mel: xform, xform -q -ro) by clarisse API: extract_translation, compute_euler_angles.
Can I get a solution for two elements from API?
tdsj4571
 
Posts: 6
Joined: Wed Apr 17, 2019 8:22 am

Re: Get Kinematics Information

Unread postby dboude » Mon Jul 22, 2019 9:46 am

Hi,

Tell us a bit more. What do you want to achieve?

Cheers ;)
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 1026
Joined: Mon Jul 03, 2017 10:51 am

Re: Get Kinematics Information

Unread postby tdsj4571 » Mon Jul 22, 2019 10:49 am

Hi,

for example,
In Maya, I could get what I want: 199.626257 94.375322 198.365088
but in Clarisse, I couldn't: -17.6580270966 -85.6751926069 16.2331687039
Isn't there any ways for solving it?
tdsj4571
 
Posts: 6
Joined: Wed Apr 17, 2019 8:22 am

Re: Get Kinematics Information

Unread postby dboude » Mon Jul 22, 2019 12:22 pm

Ok,

Try this :

python code

obj = ix.get_item("project://scene/Rotate_Cube/pCubeShape1")

# Move to frame N to get values at that time (or you can disable this line to alway get values at the current frame)
ix.set_current_frame(0)

# Get Clarisse transform
obj.get_attribute("pivot_mode").set_long(0) # "Use matrix"
rotate = obj.get_attribute("rotate")
print "Clarisse rotate: (" + str(rotate[0]) + ", " + str(rotate[1]) + ", " + str(rotate[2]) + ")"

# Get Alembic transform
obj.get_attribute("pivot_mode").set_long(1) # "Use Attributes"
rotate = obj.get_attribute("rotate")
print "Alembic rotate: (" + str(rotate[0]) + ", " + str(rotate[1]) + ", " + str(rotate[2]) + ")"

# Revert pivot mode to remove the override (if the alembic is referenced)
obj.get_attribute("pivot_mode").revert()


Let me know if it works.

Cheers
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 1026
Joined: Mon Jul 03, 2017 10:51 am

Re: Get Kinematics Information

Unread postby tdsj4571 » Tue Jul 23, 2019 2:29 am

Attribute Error is occurred..!

Message
> error: AttributeErrorerror: : error: 'NoneType' object has no attribute 'set_long' error
tdsj4571
 
Posts: 6
Joined: Wed Apr 17, 2019 8:22 am

Re: Get Kinematics Information

Unread postby dboude » Tue Jul 23, 2019 8:43 am

Hi,

Sorry, I haven't explained. This script returns the rotation of an object contained in an alembic reference. You have to replace the path of the object in the first line.

Cheers ;)
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 1026
Joined: Mon Jul 03, 2017 10:51 am

Re: Get Kinematics Information

Unread postby tdsj4571 » Wed Jul 24, 2019 2:03 am

Thank you for your help!
I could get a solution for the problem!

Have a nice day!
tdsj4571
 
Posts: 6
Joined: Wed Apr 17, 2019 8:22 am


Return to General Discussion
cron