Community
3ds Max Modeling
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max modeling topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DataChannelModifier - Tranform vertices

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
AD_GW
450 Views, 5 Replies

DataChannelModifier - Tranform vertices

Hey everyone,

 

I´m looking for a procedural way to move all vertices in a mesh which are on the positive Y Axis (world space) a certain distance in the Y direction. Vertices that are exactly on 0, should not be moved.

I´ve played around with DCM for a few hours now, but can´t find a solution.

Attached you will find an example of the desired result on a sphere.

 

Anyone got some experience with DCM and can help me?

I would like to solve this with DCM, because I have a lot of objects and don´t want to rely on any helper or volume select objects.

 

 

Thanks and best

 

 

Tags (3)
Labels (1)
  • DCM
5 REPLIES 5
Message 2 of 6
Swordslayer
in reply to: AD_GW

You can do that with the Maxscript operator, for a fixed distance it would look like this:

 

 

on Process theNode theMesh elementType outputType outputArray theTime do
(
	if theMesh == undefined then return 0
	nv = polyop.getNumVerts theMesh
	if nv == 0 then return 0
	outputArray.count = nv
	
	dist = 20

	for vert = 1 to nv do
		outputArray[vert] = if (polyop.getVert theMesh vert).y > 0 then y_axis * dist else [0,0,0]
)

 

with Maxscript operator set to Replace and Point3 output, plus Vertex Output set to Position - Add.

 

You can link use custom attributes to link the distance parameter to a spinner, check my previous posts on the topic, but if you want it to work in world space and not object space, you'd have to also add controllers referencing the node itself to the custom attributes, and in the end the amount of code would be bigger than just writing a simple maxscript modifier and maintainability much worse.

 

Then again, once you make it, it's self contained so it will work on other computers while you'd have to distribute the modifier script with the scene if you wanted it to work somewhere else, too.

Message 3 of 6
domo.spaji
in reply to: AD_GW


@AD_GW wrote:

 

I would like to solve this with DCM, because I have a lot of objects and don´t want to rely on any helper or volume select objects.

 

 


That can only be the reason to use "volume select" over your/suggested method.

You would need only 1 (box) obj. in instanced Vol. Sel. Mod.

Message 4 of 6
AD_GW
in reply to: Swordslayer

Thanks for your help, this is exactly what I was looking for.

Message 5 of 6
AD_GW
in reply to: AD_GW

Based on your script I found an alternative solution, which works quite well in my case.

Not sure if it´s 100% fool proof though.

 

Using MaxscriptInput with the script below set to replace and float (0.01 so I can use cm in scale later)

Scale modifier set to multiply

Vertex Output set to position Y and Add

 

 

on Process theNode theMesh elementType outputType outputArray theTime do
(
if theMesh == undefined then return 0
nv = polyop.getNumVerts theMesh
if nv == 0 then return 0
outputArray.count = nv

for vert = 1 to nv do
outputArray[vert] = if (polyop.getVert theMesh vert).y < 0.01 then 0.0 else 0.01
)

 

 

I am then able to set the scale value with this code:

 

$.modifiers[1].operators[2].scale

 

This bit is a little bit unclear to me. It seems like the operators array also holds deleted operaters.

As long as I don´t change anything it´s always on [2], so thats fine so far.

Message 6 of 6
domo.spaji
in reply to: AD_GW

That's not world space...

 

But I see now why you didnt want to use Vol. Select...

 

Although you could use it with texture (half black-half white) based sel. and (default) planar mapping in UV Map mod.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report