Object paint with snap

Any way to use object paint native from 3dsmax with snap?

I want to copy one object in many vertex that I have to pick in top view

Something like copy in autocad, select your object, your vertex and copy with snap where you want

Why snap is off with objectpaint?

Thanks

Comments

Comment viewing options

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

@barigazy : little advice :

@barigazy : little advice : to work with group/many selection you can make helper [point, grid] and then make it as parent , that way you can have really selection min [from helper tho]....then you can move arround those parent...when the business done you can do de-parent and then ungroup if you have a group.

I found an example on cgsociety about it, btw vid you can use it too....

tool PlaceObj prompt:"Left click to place the asset in the scene. Right click to place the asset in default position. Hold SHIFT to ignore surface orientation." numPoints:2
(
fn sortByHitDistance n1 n2 = if n1[2] < n2[2] then -1 else if n1[2] > n2[2] then 1 else 0 
 
local theAssets, gR
!REG3XP1!>local _qsort = qsort
local _translate = translate
local _matFromNorm = matrixFromNormal
local _iRay = intersectRay
local hitNodes
 
on start do
(	
setWaitCursor()
theAssets = (selection as array)
hitNodes = for o in (geometry as array) where not o.isSelected and not o.isHiddenInVpt and not o.boxMode and o.renderable collect 
(	
local snap = snapshot o
snap.wirecolor = o.wirecolor
snap	
)
gR = point pos:[selection.center.x,selection.center.y,selection.min.z] cross:off
for o in theAssets where o.parent==undefined do o.parent=gR
setArrowCursor()
)
 
on freeMove do
(
local theRay = mapScreenToWorldRay viewPoint
local hit_results = for o in hitNodes collect 
(
local n = _iRay o theRay
if n!=undefined then #(n, distance theRay.pos n.pos) else dontCollect
)	
if hit_results.count>0 then 
(
_qsort hit_results sortByHitDistance
if shiftKey then gr.transform = _translate (matrix3 1) hit_results[1][1].pos
else gr.transform = _translate (_matFromNorm hit_results[1][1].dir) hit_results[1][1].pos
)	
else gr.transform = _translate (matrix3 1) worldPoint
)
 
on mouseAbort arg do gR.transform = (matrix3 1)
 
on stop do
(
with undo off (delete gR)
with undo off delete hitNodes
select theAssets
)
)

startTool  PlaceObj
vidivini500's picture

Hi Fajar, I have some

Hi Fajar, I have some error
http://prntscr.com/2wzxmo

I've deleted "!REG3XP1!>" and it only move my object to point with snap I want (is one step). Is good but I need copy the object, not move, and more than one time, every time I pick it copy ( would be great esc or right button to finish script)

I think is the way :D

Thanks

vidivini500's picture

.....

not correct place, sorry

vidivini500's picture

Thanks barigazy, I tried it

Thanks barigazy, I tried it and other scripts, but no snap function
I only need snap to use with object paint or similar, but with all, snap turn off

barigazy's picture

...

Most of these tools use mouseTrack function which disable snap after first click.
It's not so easy to create custom function which will have both methods included.

bga

vidivini500's picture

Well, I don't need mousetrack

Well, I don't need mousetrack function, is possible make something to copy one object from one of its vertex (or pivot if is easier) to any vertex I pick with snaps?

I know you know but see this video, is exactly what I need and I think is very useful
Only a few seconds, until 2:25

http://www.youtube.com/watch?v=bpsEuvBiAgk&feature=player_detailpage#t=112

miauu's picture

.

Placing the object on the snapped vert is not a problem.

Watch this video from 4:00 min

 

By the way, what is the problem to use Paint selection to select the vertices and then to use script to place objects on the selected vertices?

vidivini500's picture

.....

Your script is great miauu but I search something simpler.
One button, pick, select object and then copy in every snap that I have actived. No rotation, no scale, no attach forever... only instance my object in selected snap

barigazy's picture

...

Use this tppl instead
http://www.scriptspot.com/3ds-max/scripts/autoplace

bga

Comment viewing options

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