MoI discussion forum
MoI discussion forum

Full Version: Axis lock

Show messages: All  1-3  4-7

From: Michael Gibson
10 Jun 2018   [#4] In reply to [#3]
Hi Barry, try setting these scripts up on shortcut keys for the X, Y, Z keys:

script: /* Snap to x direction */ var pp = moi.ui.getActivePointPicker(); if ( pp && pp.basePt ) { pp.restrictToLinePtDir( pp.basePt, moi.vectorMath.createPoint(1,0,0), true ); }

script: /* Snap to y direction */ var pp = moi.ui.getActivePointPicker(); if ( pp && pp.basePt ) { pp.restrictToLinePtDir( pp.basePt, moi.vectorMath.createPoint(0,1,0), true ); }

script: /* Snap to z direction */ var pp = moi.ui.getActivePointPicker(); if ( pp && pp.basePt ) { pp.restrictToLinePtDir( pp.basePt, moi.vectorMath.createPoint(0,0,1), true ); }

- Michael
From: Barry-H
10 Jun 2018   [#5] In reply to [#4]
Hi Michael,
thank you works great.
Many Thanks

Barry
From: Barry-H
11 Jun 2018   [#6] In reply to [#4]
Hi Michael,
I have been using the axis lock scripts and works fine but found this error report ( see photo) when selecting the move command and pressing an axis key without selecting a base point or bounding box. Would it be possible to have a prompt box reminding to pick base point rather than an error ?
Having the ability to lock axis when moving objects in the 3D view is a good feature and perhaps may become a standard part of Moi.

Again many thanks

Barry

Image Attachments:
Screenshot (114).png 


From: Michael Gibson
11 Jun 2018   [#7] In reply to [#6]
Hi Barry,

re:
> found this error report ( see photo) when selecting the move command and pressing an axis key
> without selecting a base point or bounding box.

That's actually a bug in the point picker script interface. The JavaScriptCore engine doesn't like it if a property value of 'undefined' is returned if we've told it a particular property name exists, it needs to return null instead.

I've got it fixed up so the next v4 beta shouldn't show that error anymore.

- Michael

Show messages: All  1-3  4-7