Notifications
Clear all

[Closed] Progressive selection

Hi all,

short version: how can i make a sphere (mesh) selects automatically the vertices of a line passing with the sphere over them?
(like volume select modifier)

a bit longer version:
i would need to write a little script that selects the knots of a spline in progression, starting from #1 to the last, and according with the position of a “selection object”…take a sphere for example that runs over a path spline
A bit like the Volume Select modifier but something that will pass vertex selection to a morpher upper on the stack
I’m really a newbie in maxscript, but it seems to me that the volume select converts the spline in something like a mesh and it don’t pass selection values to the morpher
to select knots i’ve done something like that:

SF = $sphere01
LI = $linea
NUM = numknots li 1

for i = 1 to NUM do
(
setKnotSelection LI 1 #(i) keep: true
)

8 Replies

I’m not sure if I can help you or not because I can’t understand what your question is

Hi,

the vol select modifier permits to select the vertices of a mesh -or spline- that are contained in a mesh volume of your choice.
So i can make a sphere, give it a path controller and let it select the vertices of another mesh (or spline) during the travel on its path.

I want to apply a morpher modifier to the object (in this case a spline) -in which i’m doing my vertices selection – and then apply that morpher just to that selection.

my main goal is to let the spline change its shape in a target shape (morpher) during the passage of the “selection object”, in this case a sphere.

vol select modifier actually don’t seem to pass the selection up to the stack for spline objects (it works for meshes) ,right to the morpher modifier…

and so i’m looking for a way to do a progressive selection of the vertices of that spline, using the passage of that object (sphere) ,using maxscript

anyway thank you for trying and sorry for this trekkie-dialogue

Ah, ok.

Well, the volume select modifier DOES pass the selection up the stack for spline objects…although what it is selecting and passing up is the vertices of the spline’s mesh, not the control points on the spline.

I haven’t even used the morpher modifier before but my understanding of a morph is that it moves the vertex positions from one mesh to another mesh that have the same number of vertices. I assume that you you have a complete copy of the spline and you want to only morph the part that is being selected…but I think the way the selection stack works is that the morpher material would only SEE what’s in the selection, meaning that even if you COULD pass the control points up the stack, the morpher material would give you an error because it would think you didn’t have enough vertices to match the other object. I could be wrong, but you should try this out on a mesh first to see if it works or not.

That said, it might not be too hard to simply write a maxscript that does the volume select and morphing all by itself. You could simply iterate through each vertex to see if it is within the bounding box of another object (I hope you dont need to do it for complicated/concave meshes!) and then you could move the position of the control point by comparing those to another spline…without actually ever doing any “selection” by max

Hi

thank you very much, you understand perfectly my problem
And i can tell you that with meshes the trick works well…and it’s a very nice way to achieve a lot of effects (footprints, progressive cracks etc)

i’m currently able to do the progressive selection, what i’m missing is how to make that “control” with bounding box etc to understand when the “selection object” pass over a spline point and so to increment the selection over the spline (a simple for cycle)
i think it’s basically a “collision” test or something like this

i’d do this sort of stuff with regular max methods. if you have a simple circle, try using a cylinder as your volume select object, then animate it’s slice parameters so it progressively grows to a cricle

if you have a random spline i’d copy that spline, then let a cylinder grow along the length of that spline using path deform, then you can use that as your volume select gizmo

Hi Aroon

thank you all for your help…i’ve solved yet with “traditional” methods
(path deform or a loft with animated scale section) but i’m trying also to understand some basic maxscript…
anyway here what i’ve written:

global PrSplSEL = fn PrSplSEL =

(
SF = $sphere01
LI = $line01
NUM = numknots li 1

for i = 1 to NUM do

(
PPi = getknotpoint LI 1 i
–if isPointSelected LI i = false then (
if ( SF.min.x < PPi.x and PPi.x < SF.max.x and
SF.min.y < PPi.y and PPi.y < SF.max.y and
SF.min.z < PPi.z and PPi.z < SF.max.z ) then

	setKnotSelection LI 1 #(i) keep: true

)
)
registertimecallback PrSplSEL

it works for me…(forgive me about all the errors you will find, i’m trying to understand something in this new world

with –if isPointSelected LI i = false then… i was trying to find a solution to let the script works at reverse mode also…so when the sphere find a selected spline vertex i want to DESELECT it…when i find a DESELECTED vertex i want select it…
to try my poor script just animate a sphere (called sphere01) over a spline (line01)

thank you all again

Hey, well done Mork74!!!

Happy you start to walk in the dark side of the Power!

see you soon;
AlexNardini

Hello mate how are you? your fame crosses the ocean, just like your amazing wave (!!! )
Hope you’re doing well (for sure) and i’m looking forward to meet you.
As you can see i’ve been looking around for some maxscript stuff (i was doing a kind of zipper and i remembered once you told me about that vol sel + morpher trick -do you remember?-)
Here everything is well, and i’m still working on my yellow side of power (you know, they are conquering the world
There are also some indipendent projects on which i’m dreaming, we’ll see…
A very very big hug, and when you are in the mood, just tell me some of your british adventures

cya soon

Massimo