snap ignore object

so, there´s any way to make the snap ignore some object?

i know an easy solution would be freeze the object and set "snapmode.tofrozen = false".
But the object must be visible and cant be frozen.

any ideas?

Comments

Comment viewing options

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

intersting. i gave it a try

intersting. i gave it a try but only achieved some workaround.

i tested with boxes and teapots so no "special" object or geometry types.

my idea was to use the transform change handler, check for valid snapping, if snapping valid then searching the "blacklist" (for forbidden objects) and disabling the snapping display for the forbidden objects.

if this works fine for your needs creating a dialog with (blacklist) selection and save settings etc. should not be the problem.

hope this helps a bit!

-- delete own change-handler(s)
deleteAllChangeHandlers id:#trChan
 
 
 
-- made some testobjects and pass the names
snapBlacklistNames = #("b4","b3","b1","b5")
 
-- --> in this array should be the objects that should not react to snapping
snapBlacklist = #()
 
 
-- loop for filling the testobjects by names into the object array
for s in snapBlacklistNames do (
		tmpObj = getNodeByName s
		appendIfUnique snapBlacklist tmpObj
		-- print ("tmpObj: "+tmpObj as string)
) -- end for
 
 
when transform $ changes id:#trChan do (
 
	-- print ("snapNode: "+snapMode.node as string)
 
	if snapMode.node != undefined do (
 
		if (findItem snapBlacklist snapMode.node != 0) then (
				print "DO NOT SNAP"
				snapMode.display = false
		) else (
				print "start snapping -again"
				snapMode.display = true
		) -- end else
 
	) -- end if
 
 
) -- end when
mjbg's picture

Thank you for your

Thank you for your help

havent had the chance to try it yet
but wouldnt the snapmode.display just "hide" the snap but the snap will continue to work as usual for the all the objects?

well thanks anyway.. will try it first thing tomorow

Comment viewing options

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