Movement controls visibility

Hi all,
Is there a way to connect an object´s transform (M/R/S)to other object´s visibility and modifiers? In the attached image, a sphere moves (-Y axis)in an array of objects. 1- As it touches each object, they became visible (those in white). 2- Then, some rows behind, each row begins to fold into a ring (those in magenta). In 1-, the simple (and draft) way is to link the sphere movement to each object, by comparing their Y position (in natural language: if Y of sphere is greather than obj Y, then obj is visible). This is without checking surface intersections ofcourse, but never used script before and seems I cannot script even that simple rule.
In 2-, all the row has a parametric bend modifier that could be set in the same way (as the sphere passes), but for now is animated by hand. So, I thanks in advance those who are kind enough to spare some time and help me in this matters (and excuse my english).
Thanks,

AttachmentSize
sceenshot1.jpg43.01 KB

Comments

Comment viewing options

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

animate bend modifier

I have finished the script to animate the bend modifiers. Its the same as the unhide script, but with the bend modifiers. Can you send me in private, this is a script that will only works in your scene. So we can handle this in private.

AttachmentSize
bendbymovement.ms 5.29 KB
JokerMartini's picture

cool concept here. You should

cool concept here. You should share what your final product is when your finished.

John Martini
Digital Artist
http://www.JokerMartini.com (new site)

jos's picture

new update

the error should be fixed now. if appendIfUnique is not working on your system it doesnt check for duplicates.
It also works a hundred times faster.
you can delete the visibility animation, so you can change it easily.
thank you barigazi for the tips, I've add them
I have tested with your file and it works. If I find the time I'll look make a version that animates the bend modifiers.

AttachmentSize
unhidebymovement.ms 5.05 KB
maxmad's picture

Works like a charm!

Jos, U rock man!
Thank you very much! Simple UI, efficient, and spare several minutes of tweaking. (Where is the worship emoticon when u need it?) ^:)^

GD,CG artist

kimarotta's picture

good job guys ... I'll give a

good job guys ...
I'll give a study on top of the script that you guys wrote ...

kimarotta.com.br
3d Artist  

barigazy's picture

This is also interesting example

This is also interestin example by Bobo
Maybe you'll get some idea for the next update

delete objects
with redraw off 
(
	theBox = Box width:10 height:10 length:10 wirecolor:(random black white)
	for y = 0 to 9 do for x = 0 to 9 do ((copy theBox).pos = [20*x, 20*y, 0])
	delete theBox
)
max views redraw
cb = Sphere name:(uniquename "CtrlBall")radius:100.0 pos:($Box*.center+[0,0,100]) isSelected:on xray:on
for o in $Box* do
(
        o.wirecolor=(random black white)
	o.height.controller = float_script()
	txt = "dependsOn $CtrlBall001.pos.controller\n"
	txt +="theInt = IntersectRay $CtrlBall001 (Ray $" + o.name +".pos [0,0,1])\n"
	txt +="if theInt != undefined then \n"
	txt +="if (theDist = length (theInt.pos - $" + o.name +".pos)) > 100 then 100 else theDist\n"
	txt +="else 100\n"
	o.height.controller.script = txt
) 

barigazy

jos's picture

fade in

"Fade in over .. frames" added. this is the number of frames it takes before it's totally visible. So you can create a fade-in effect.
So how it works:
- pick control object. can be any object. If you pick a sphere the radius will be autotaken
- set radius.
- choose axes
- choose over how much frames it has to fade in. If you dont want this, just set this to 0
- choose time range
- press Animate visibility
I'll will expand this script later and post it. future plans. (hide or unhide, fade back out over a choosen time, center visibility so in the center total visible and at the ends less visible, ...) hope for user requests!

AttachmentSize
unhidebymovement.ms 3.34 KB
maxmad's picture

Update:

Hi Jos,
Thanks again for your time. Options and parameters usefull, as the wishlist to expand it ;)
Howerer, it seems to be something uncompatible (could be the 3dsMax v.9?) When I click "Add Slaves" (having selected objects),
got an exception:
"Type error: Call needs function or class, got undefined"
at this line:
"for obj in selection do appendIfUnique ListOfObjects obj"
When none is selected, clicking the "add slaves" button have no action.

GD,CG artist

jos's picture

hmm I guess the

hmm I guess the appendIfUnique method isnt supported in max9. I'll make an update tommorow.

barigazy's picture

just look your mail

just look your mail

barigazy

Comment viewing options

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