objects flips after instanceReplace

objects flips after instanceReplace

jens.diemer
Collaborator Collaborator
685 Views
4 Replies
Message 1 of 5

objects flips after instanceReplace

jens.diemer
Collaborator
Collaborator
I use this script http://www.scriptspot.com/3ds-max/scripts/instance-replace
I replace many objects with instanceReplace

The problem: A few objects flips (like mirror). Or the object rotate?


Here a test script:
fn DumpObjInfo obj = (
format "____________________________________________\n"
format "DumpObjInfo for object: %\n" obj

format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "rotation " obj.rotation
format "%:\t%\n" "pivot " obj.pivot

format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
format "%:\t%\n" "objecttransform " obj.objecttransform
)

obj_x=$'oben'
obj_y=$'unten'

DumpObjInfo obj_x
DumpObjInfo obj_y

format "------------------------------------------------------"
instanceReplace obj_x obj_y
format "------------------------------------------------------"

DumpObjInfo obj_x
DumpObjInfo obj_y


The output is:
OK
DumpObjInfo()
ResetAll()
$Editable_Poly:oben @
$Editable_Poly:unten @
____________________________________________
DumpObjInfo for object: $Editable_Poly:oben @
transform: (matrix3 )
rotation : (quat -0.5 -0.5 0.5 0.5)
pivot :
objectoffsetpos :
objectoffsetrot : (quat 0 0 0 1)
objectoffsetscale:
objecttransform : (matrix3 )
OK
____________________________________________
DumpObjInfo for object: $Editable_Poly:unten @
transform: (matrix3 )
rotation : (quat -0.5 -0.5 0.5 0.5)
pivot :
objectoffsetpos :
objectoffsetrot : (quat 0 0 0 1)
objectoffsetscale:
objecttransform : (matrix3 )
OK
------------------------------------------------------OK
$Editable_Poly:oben @
------------------------------------------------------OK
____________________________________________
DumpObjInfo for object: $Editable_Poly:oben @
transform: (matrix3 )
rotation : (quat -0.5 -0.5 0.5 0.5)
pivot :
objectoffsetpos :
objectoffsetrot : (quat 0 0 0 1)
objectoffsetscale:
objecttransform : (matrix3 )
OK
____________________________________________
DumpObjInfo for object: $Editable_Poly:unten @
transform: (matrix3 )
rotation : (quat -0.5 -0.5 0.5 0.5)
pivot :
objectoffsetpos :
objectoffsetrot : (quat 0 0 0 1)
objectoffsetscale:
objecttransform : (matrix3 )
OK

Jens

------------------------------------------------------------------------------------------------------------------
https://github.com/jedie/3dsmax_bugs | https://github.com/jedie/3dsmax_patches
0 Likes
686 Views
4 Replies
Replies (4)
Message 2 of 5

jens.diemer
Collaborator
Collaborator
instance_replace_bug_a.jpg is before starting the script.
instance_replace_bug_b.jpg is after the script runs.

btw., ResetTransform or ResetPivot doesn't do anything.
Jens

------------------------------------------------------------------------------------------------------------------
https://github.com/jedie/3dsmax_bugs | https://github.com/jedie/3dsmax_patches
0 Likes
Message 3 of 5

PiXeL_MoNKeY
Collaborator
Collaborator
It makes sense, notice the transforms for both objects is the same (except the vertical position). When you do instance replace it replaces the object. In this case the object is flipped in the object stack (base object or modifier), and not in the transformation.

-Eric
0 Likes
Message 4 of 5

jens.diemer
Collaborator
Collaborator
Yes. The Problem is, the object geometry is flipped "internal" and not the transformation of the object.

Is there is any changes to handle this in a script???
Jens

------------------------------------------------------------------------------------------------------------------
https://github.com/jedie/3dsmax_bugs | https://github.com/jedie/3dsmax_patches
0 Likes
Message 5 of 5

Anonymous
Not applicable
Yeah, I'm interested if you can replace only the mesh, but not affect the nodes transform. So the mesh is instanced, but it would keep the pos/rot/scale intact.

Right now my make instance of tool sort of does this, but sometimes the object will move from where it was after making it an instance of another object. Not sure why it only does it sometimes...
0 Likes