Home Technical Talk

Can't add a macroscript to a maxscript.

Junkie_XL
polycounter lvl 14
Offline / Send Message
Junkie_XL polycounter lvl 14
I can't seem to add a macroscript above this maxscript. Was wondering if someone could help take a look at it for me? Reads as follows...
/* This will reset transforms & rotate the pivot so Y is up. */

macroScript ResetXFormCollapseRotate
category:"Custom Tools"
buttonText:"XForm++"
toolTip:"Reset XForms & Rotate Pivot"

(
on execute do
(
ResetXForm $

macros.run "Modifier Stack" "Convert_to_Poly"

fn RotatePivotOnly obj rotation =
(
local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
RotatePivotOnly $ (EulerAngles 90 0 0)
)
)

edit: I should add this works fine and does what I want otherwise. It's just when those first 4 lines for the macroscript are added it wants to break as it approaches the "fn". I'm a bit of a maxscript n00b so any help would be appreciated...

Replies

Sign In or Register to comment.