first vertex snap

Hi there,

this is what I need to do.
In 3DSMAX I have an object and lot of splines which I created from HAIR&FUR modifier.
I want to snap this object onto the first [or TOP] vertex of each spline [along the vertex normal].
This way I could create lot of foliage types by creating base of the flower with hair&fur and snap the top of the flower with the script.

I tried to use OBJ2SPL ALIGNER but it does not work with more than one splines

Do you have any recommendations how to achieve this effect?

Comments

Comment viewing options

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

test

I want to create some lake bushes with this script. I am attaching test render.

Again, thank you.

AttachmentSize
chlpy2.jpg 123.92 KB
barigazy's picture

very nice.Just keep it up,

very nice.Just keep it up, man

barigazy

barigazy's picture

test2

This example create instances of 4 different flower object
in the random way and do the same job and "test1" example.
NOTE: You can use more than 4 flowers
Open test2.max and run the code below

fn placeFlowers grassLines: flowersArr: =
(
	for g in 1 to numSplines grassLines do
	(
		seg = (numKnots grassLines g) - 1
		flowersArr[g].pos = interpBezier3D grassLines g seg 1.0 pathParam:true
		flowersArr[g].dir = tangentBezier3D grassLines g seg 1.0 pathParam:true
	)
)
 
grass = $grassLine001
fArr = #($F1_001, $F2_001, $F3_001, $F4_001)
cnt = fArr.count
while fArr.count < numSplines $grassLine001 do
(
	fCopy = instance fArr[random 1 cnt]
	fCopy.wirecolor = random black white
	append fArr fCopy
)
 
placeFlowers grassLines:grass flowersArr:fArr

AttachmentSize
test2.max 340 KB

barigazy

blop's picture

thx

nice! .it's pretty sweet !

good job
than you

barigazy's picture

test1

First code and file(max2010x64 +) example(see attachment):
Make instances of single flower, randomize wirecolor and place it on the last knot of the splines extracted from Hair Modifier.
Number of flower = number of splines
Open test1.max and run the code below

fn placeFlowers grassLines: flowersArr: =
(
	for g in 1 to numSplines grassLines do
	(
		seg = (numKnots grassLines g) - 1
		flowersArr[g].pos = interpBezier3D grassLines g seg 1.0 pathParam:true
		flowersArr[g].dir = tangentBezier3D grassLines g seg 1.0 pathParam:true
	)
)
 
flower = $Flower001
grass = $grassLine001
fArr = #(flower)
for s in 1 to (numSplines grass - 1) do
(
	fCopy = instance flower
	fCopy.wirecolor = random black white
	append fArr fCopy
)
 
placeFlowers grassLines:grass flowersArr:fArr

AttachmentSize
test1.max 252 KB

barigazy

barigazy's picture

Attach a test file.

Attach a test file.

barigazy

Comment viewing options

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