Notifications
Clear all

[Closed] Grouping parameters

I’ve never done any scripting in Max before. I’m using 5.1

I’m currently working on visualisations for fountains, this means tons of particle emiters.
I need to control the emiters in groups with a few parametes like, Speed and Emit stop and Display stop and so on.

So far, I’ve been wiring parameters to a few helper sliders, but wiring emiters and parameters one-by-one takes ages, and seems like a waste of time to me. :banghead:

So I thought scripting may be the best solution.
Or have I overlooked some basic Max method to mass-set parameters ?

  • A script that takes selected objects and wires all of their selected parameters to a manipulator at once ?

  • Or to use the particle emiters preset save function, a script that loads a preset to all of the selectec emiters at once.

Can you guys help me , with an existing script similar in function to the above, or help me out in writing my own ?

Ps:
One more question is there a way to instance emiters ? Why can’t instanced objects inherit parameter wiring ? Thats two, actually.

6 Replies

Well I was hoping for a bit more responce then this. I sometimes feel I’m being ignored by CGTalk users as part of some conspiracy, but I guess thats just normal everday paranoia.

try this:

create a superspray and copy the superspray say 10 times

make a dummy called dummy01

give it a Custom Attribute spinner name it speed. You can add it through the parameter editor which is found in the animation menu.

create a new script or in the maxscript listener window type:

$SuperSpray*.speed.controller = float_script ()

Press return and all the super sprays should have script controllers assigned to the speed track.
Make sure you select all the supersprays, then type in the listener:
[size=1]
$.speed.controller.script = “dependson $Dummy01
value = $Dummy01.baseObject.Custom_Attributes.speed
value “
[color=#fffffe]
As one line and press return, changing the CA spinner on dummy 01 should change the speed parameters on all of the super sprays.

Which should take about three minutes and save a lot of clicks!

[/color][/size]

Hello ,djlane, and thank you for your time !

I’ve followed your instructions.:

  1. Made SuperSpray
    • made a spacewarp(gravity) so I can see the speed changes better
    • binded the sw to the SuperSpray
  2. Multiplyed it a few times
  3. Made Dummy1 dummy object
  4. Assigned a custom spinner named speed to Dummy1
  5. new script: 1. line of code – enter – 2. line of code – saved script
  6. Selected all SuperSpays
  7. Ran Script —– this is where I got stuck

I get an error message saying : – Unknown property: “speed” in $selection,
and the scipt window highlights the second line of code.

here is a screengrab >>>

I don’t want to waste your time and I think I kinda understand the code you have given.
So I’ll try to make it work myself. Maybe Max 5.1 does not allow the sript to use that property. Just a thought. Is there a way to list the available(scriptable) properties of an object ?

If I’m totally in the dark on this one please let me know. Maybe the error is not about the property being available.

looking forward to your reply 😮

I didnt have max to hand when I wrote that so I didnt test it sorry! Though I think the last line would have worked if you had typed it in the listener rather than ran it from script editor(my fault), This should sort it out though.
replace your old code with this and hit evaluate:

$SuperSpray*.speed.controller = float_script ()

allSprays = $SuperSpray* as array

for i in allSprays do

(

i.Speed.controller.script = “dependson $Dummy01
value = $Dummy01.baseObject.Custom_Attributes.speed
value “

)


This should do it all in one go.
Make sure your dummy is called dummy01 if it isnt then just update this code with your dummys name.

You could take it further so your script actually creates the sprays and dummys and CA spinners as well as applying the controllers.

Cheers

Dan

Thanks you ! Works great ! :applause:

Could you recommend a book on getting started with MAxScript ?

I have some scripting (ActionScript) experience, so it doesn’t have to be that basic.
Just a good reference with lots of examples.

I bought a book called mastering maxscript from sybex, it was ok and was a good for getting me started and nice to have an alternative to the docs for some things. Its abit old now, It only covers up to max3. lyric media and cg-academy do training videos, I purchased bobo`s dvd which was pretty good for tips on how to sprinkel maxscript one liners into everyday workflow.

The best ones I think would be either lyric medias training or the first dvd on maxscript by cg-academy. I haven’t got them myself but from reading the contents descriptions they sound like the best place to get you into maxscript fast. Also check out turbo squid they may have some training material.

Actually before you buy anything go to script spot and check out the tuts there and the free video tutorials by gavinb.

Cheers

Dan