Isotropix Forums

layout other software

General Discussion about Isotropix and CG related topics

layout other software

Unread postby dp_mg42 » Mon Sep 20, 2021 9:07 am

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?
dp_mg42
 
Posts: 13
Joined: Tue Jan 17, 2017 6:08 pm

Re: layout other software

Unread postby aaute » Thu Sep 23, 2021 5:12 pm

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)
attrP.set_vec3d(pos)
attrR = newObj.get_attribute("rotate")
ix.cmds.LocalizeAttributes([attrR.get_full_name()], True)
attrR.set_vec3d(rot)
attrS = newObj.get_attribute("scale")
ix.cmds.LocalizeAttributes([attrS.get_full_name()], True)
attrS.set_vec3d(scl)


Cheers
Aymeric
Isotropix
Technical Artist - Clarisse Specialist
User avatar
aaute
 
Posts: 90
Joined: Mon Nov 02, 2020 11:59 am


Return to General Discussion