checking snap options

HI

I want to write a simple script instead of the 3DS to set snap options (snap to grid lines, snap a vertex, etc.). I want to: right click on my checkbox - setting on only the snap I need and disable the rest. What command stands for checking snap (for example, snap to grid)? Unfortunately commands like

actionMan.executeAction 1259304063 "50073"

operate on the principle of switching on/off without switching state = true / false

Comments

Comment viewing options

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

Override (Natively)

Hi guys, Shift+RMB brings up a menu to enable snap override.

I enable midpoint and vertex as defaults and any time I need anything else I do this.

BTW you do don't need to turn on fancy snaps to move the pivot when you affect pivot inside that command. Just hover over the little yellow circle.

Snapping in max is unintuitive, but by adding alt+D mapped to turning off/on axis contrasts it changes to been normal once you get used to it.

Also:
F5 restraints to X axis
F6 to Y axis
F7 to Z axis
F8 toggles different planes.

AttachmentSize
override_snap.jpg 139.53 KB
pivot.jpg 95.31 KB
miauu's picture

.

I had the idea to write such a script. :)
I already hava all the code that I need. Just have to put the parts together. :)
Some of my scripts in Script Pack vol.2 automatically turns off all snap options and turns ON only the snap to Vertex. When the script(the user) finish its job, all snap options are restored at their initial states(before to run the script).

Note that some external plugins(for example powerNurbs) adds its own Snap options which may/will change the default snap settings.

barigazy's picture

...

Yep. Or some custom snap plugin.
In max2014 is added PointCloud snaping option which changed order from previous version. But maxscript 2014 help is not updated as well.

barigazy

barigazy's picture

...

Info for snap struct here
http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help//index.html?url=fi...
This function works for max2014

fn setSnapMode name: state: =
(
	case name of
	(
		"Grid Points": snapmode.setOSnapItemActive 4 1 state
		"Grid Lines": snapmode.setOSnapItemActive 4 2 state
		"Pivot": snapmode.setOSnapItemActive 5 1 state
		"Bounding Box": snapmode.setOSnapItemActive 5 2 state
		"Perpendicular": snapmode.setOSnapItemActive 6 1 state
		"Tangent": snapmode.setOSnapItemActive 6 2 state
		"Vertex": snapmode.setOSnapItemActive 7 1 state
		"Endpoint": snapmode.setOSnapItemActive 7 2 state
		"Edge/Segment": snapmode.setOSnapItemActive 7 3 state
		"Midpoint": snapmode.setOSnapItemActive 7 4 state
		"Face": snapmode.setOSnapItemActive 7 5 state
		"Center Face": snapmode.setOSnapItemActive 7 6 state
	)
	max drawingaids; max drawingaids
)
-- check vertex checkpox
setSnapMode name:"Vertex" state:on 
-- uncheck grid points checkbox
setSnapMode name:"Grid Points" state:off

barigazy

Drathir's picture

thx a lot men :) exactly what

thx a lot men :) exactly what I was looking for.

Haider of Sweden's picture

.

Drathir, I would love to see what script you got out of this code.
As a former Maya user, I remember how easy it was to use only the snap you needed while max requires you to enter a UI where you turn on/off snaps.

Kind regards
Haider
www.haider.se

miauu's picture

.

This can make using Snaps in Max much more comfortable :)

barigazy's picture

...

Very cool. Are you plan to add Axis Constrain option later or I miss that in video.

barigazy

Haider of Sweden's picture

.

Indeed a splendid solution. Well done miauu!

Kind regards
Haider
www.haider.se

barigazy's picture

...

That's because max have more "snaps" then maya :)

barigazy

Comment viewing options

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