Page 1 of 1

Get kenimatic world path of abc mesh

Unread postPosted: Wed Jan 15, 2020 12:14 pm
by qinyao
Hi, friends,
I import a abc mesh which exported from maya including groups, how can I get the parent/child full structure path by script? I found this path in hierarchey view, just wanna know how to get this variable.

Re: Get kenimatic world path of abc mesh

Unread postPosted: Wed Jan 15, 2020 1:49 pm
by anemoff
Hi,

You can use the ModuleSceneItem API, like this:

py code

obj = ix.get_item('path/to/item')
mod = obj.get_module()
if mod.is_kindof(ix.api.ModuleSceneItem.class_info()):
print mod.get_kinematic_full_name()
else:
ix.log_error('Error: {} is not a SceneItem, it has no kinematic hierarchy.'.format(obj))


Result example:
Code: Select all
world://Trex_TREX/Trex_TrexMod/Trex_HeadGrp/Trex_skullShape

Is this what you are looking for?

Cheers,

Re: Get kenimatic world path of abc mesh

Unread postPosted: Thu Jan 16, 2020 2:43 am
by qinyao
Exactly what I want! Thank you!