Notifications
Clear all

[Closed] Create shapes in front viewport?

I’m just trying to be tidier by posting a new topic – I’m creating circles and rectangles for joysticks, but by default max creates them top-down.

After I parent the circle to the rectangle, I then rotate the rectangle 90 degrees, but I feel a little bit ‘hacky’ doing this, and wondered if it was possible to create the original shapes in the correct orientation? Can I add a transform matrix3 into the creation?

6 Replies
1 Reply
(@bobo)
Joined: 1 year ago

Posts: 0

Why don’t you use a manipulator plugins for this?
http://www.scriptspot.com/bobo/mxs4/joystick/

Ah, well for this problem it’s not limited to the joysticks – I’ve got other applications for drawing shapes onto the front plane. I’ve already hacked this positional method into a few of my scripts (displaying a models name for renders for one), and just wanted to clean up my scripting.

As for the joysticks, I’m trying to write a modular system for us, and rather than taking an off the shelf solution I want to write my own so that I learn more about maxscript. I’ve figured out maxscript wiring and exposetransforms for connecting twistbones and building complex rigs (and I’m dealing with HUNDREDS of these), so the next step is using the xml load/save animation to make our facial animation work across hundreds of unique rigs.

1 Reply
(@bobo)
Joined: 1 year ago

Posts: 0

Fair enough.

After creating a shape in Front view, you could call resetXForm() on it and then collapse the stack to Editable Spline (SplineShape). This will keep the shape oriented at the front viewport, but its TM will be aligned to the world and this contain no rotation.

It’s the creating the shape in the front view that it is the issue – I’m trying to overcome the default top-down creation.

I’m wondering if transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] 1) in the creation of each object will work.

I just don’t have max in front of me.

Got it – i think.

Adding

transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,0])

to the creation of the shape will create it in the front viewport.

    jsbox = Rectangle length:jsl width:jsw cornerRadius:jscor position:[0,0,0] name: ("JSB_" + jsn) wirecolor:(color 250 230 100) transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,0]) isselected:on

Got it – I think so anyway.

Adding

transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,0])

to the creation of the shape will create it in the front viewport.

    jsbox = Rectangle length:jsl width:jsw cornerRadius:jscor position:[0,0,0] name: ("JSB_" + jsn) wirecolor:(color 250 230 100) transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,0]) isselected:on