Mirror object/group on X or Y axis

Hi :)

Hopefully somebody can help me out here.

I'm looking for a script that easily mirror and object/group on the X or Y axis. I know that there are scripts that already do this, but they are part of another pop-up. I just like to attach it as a simple button i can press.

I've tried some stuff in the script below but my scripting skills are not well.

Thank you :)

AttachmentSize
mirror_selection.ms80 bytes

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
obaida's picture

Actually, Mirror in 3dsMax is

Actually, Mirror in 3dsMax is a negative scale on the Mirror Axis
but it should be written as (scale $ [-1,1,1]) not ($.scale = [-1,1,1])

obaida's picture

duplicated...

duplicated...

miauu's picture
llp103ping's picture

Link is broken

Hello, this link can no longer be opened. Could you please tell me how the script is written? Thanks!

miauu's picture

.

Code by denisT

global MirrorDialogPos = unsupplied
 try
 (
      MirrorDialogPos = getdialogpos MirrorDialog
      destroydialog MirrorDialog
 ) 
 catch()
 rollout MirrorDialog "Simple Mirror" width:200
 (
      radiobuttons axis_rb labels:#("X","Y","Z   ") 
      button mirror_bt "Mirror Selection" width:192 align:#right offset:[8,0]
 
      local axis_types = #(#x, #y, #z)
 
      fn oppositeTM tm axis:#x nodes: = 
      (
            local rot_tm, ntm
            if ini == unsupplied do ini = tm
 
            local xm = case axis of
            (
                         #x: (matrix3 [-1,0,0] [0,1,0] [0,0,1] [0,0,0])
                         #y: (matrix3 [1,0,0] [0,-1,0] [0,0,1] [0,0,0])
                         #z: (matrix3 [1,0,0] [0,1,0] [0,0,-1] [0,0,0])
                  default: (matrix3 1)
            )
            tm * xm
      )
      on mirror_bt pressed do undo "Mirror" on 
      (
            for node in selection as array do node.transform = oppositeTM node.transform axis:axis_types[axis_rb.state]
      )
 
 )
 createdialog MirrorDialog pos:MirrorDialogPos
llp103ping's picture

Thank you!

Thank you!

remykonings's picture

Works :)

Thanks for the link. It works now :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.