ScriptSpot home

Transform pivot point with a matrix3 tm

Downloads

Release history (1)
  • Version 1Listed version

    Listing updated

    No download linked to this version

3ds Max compatibility
Unknown
Community reviewsNo reviews yet.

Listing details

Version
1
Author’s update date
Listing created
How compatibility works

Compatibility comes from the author’s supported range or requirements in the original listing. A tested version records what the author tried.

“2020 unconfirmed” in the catalog means support for 3ds Max 2020 is still unknown.

Community reports record successful tests on specific releases.

Posted by

lutteral

More by this author

Description

I wrote this function a while ago for an exporter tool, where I needed to align the pivot of collisions objects with the transform of the master object. I couldn't find another way to "affect pivot only" (as in the UI) using maxscript, It will set the .transform (a.k.a. the pivot point) of a node to the provided matrix3. It gives more possibilities than the standard "affect pivot only:" from the user interface, as you have full control of the transformation matrix. Here's the function:

<code>

fn setTM obj tm =

(

newOffset=obj.ObjectTransform *(inverse tm) -- calculate the offset in the target TM space

obj.objectOffsetScale=newOffset.scale

obj.objectOffsetRot=newOffset.rotationPart

obj.objectOffsetPos=newOffset.pos

obj.Transform=tm

)

</code>

Comments (0)