Page 1 of 1

layout other software

Unread postPosted: Mon Sep 20, 2021 9:07 am
by dp_mg42
hi i have a huge scene and use maya for layout and export abc to clarisse and i want replace asset with highpoly version in clarisse. can anyone help how can do it?

Re: layout other software

Unread postPosted: Thu Sep 23, 2021 5:12 pm
by aaute
You can use this script.
First select the new object it s going to replace the old one and continue your selection with all the objects you want to replace.

python code

sel = ix.selection
count = sel.get_count()

if count > 1:
theNewObject = sel[0]
for i in range(count):
if i > 0:
obj = sel[i]
pos = obj.get_attribute("translate").get_vec3d()
rot = obj.get_attribute("rotate").get_vec3d()
scl = obj.get_attribute("scale").get_vec3d()
newInstance = ix.cmds.CreateInstanceTo(theNewObject, "build://project/scene/context")
newObj = ix.get_item(newInstance[0])
attrP = newObj.get_attribute("translate")
ix.cmds.LocalizeAttributes([attrP.get_full_name()], True)
attrR = newObj.get_attribute("rotate")
ix.cmds.LocalizeAttributes([attrR.get_full_name()], True)
attrS = newObj.get_attribute("scale")
ix.cmds.LocalizeAttributes([attrS.get_full_name()], True)