Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

Maxscript miniscript help please
show user profile  herfst1
Hi scripters,

I need some help writing out a simple maxscript. What I'm wanting to do is:
1. create a dummy on [0,0,0]
2. select all visible geometry
3. Link geometry to dummy
4. autokey the dummy downwards on the z axis in increments per frame (e.g. frame 0 it's on [0,0,0], then [0,0,-10], [0,0,-20] etc.

P.S. This is not urgent at all, I just wanted to have this process on auto for the future. Cheers.
read 535 times
10/3/2014 7:51:56 AM (last edit: 10/3/2014 7:53:29 AM)
show user profile  3joez
Since I'm not sure about the fourth step, here are the first three. I'm sure sombebody else will fill the gaps


d = dummy()
hide d
allVisible=#()
for o in objects where not o.isHiddenInVpt do append allVisible o
unhide d
allVisible.parent = d
Photobucket

read 517 times
10/3/2014 11:11:04 AM (last edit: 10/3/2014 11:11:04 AM)
show user profile  herfst1
Cool. Thanks Joez. I really appreciate it.

Quick question: the "o." What does that represent, is it object?
read 516 times
10/3/2014 11:18:10 AM (last edit: 10/3/2014 11:18:10 AM)
show user profile  Nik Clark
o us being used as a container, an array in this instance, so individual objects withing it can be addressed.




read 512 times
10/3/2014 11:25:28 AM (last edit: 10/3/2014 11:25:28 AM)
show user profile  herfst1
Okay, so like "d = dummy()." Thanks, Nik. I assumed (assuming I'm not incorrectly assuming) that you always had to state what the string represented first before you could "call" it to do something withing maxscript.
read 509 times
10/3/2014 11:28:40 AM (last edit: 10/3/2014 11:28:40 AM)
show user profile  Nik Clark
No worries. It's quite common in maxscript.

For example.

for i in selection do i.property=x

for changing a property of multiple selected objects.



read 506 times
10/3/2014 11:30:50 AM (last edit: 10/3/2014 11:30:50 AM)
show user profile  herfst1
Gotcha.
read 496 times
10/3/2014 11:51:07 AM (last edit: 10/3/2014 11:51:07 AM)
show user profile  3joez
Ok, that should do the trick


d = dummy()
hide d
allVisible=#()
for o in objects where not o.isHiddenInVpt do append allVisible o
unhide d
allVisible.parent = d

startTime = animationRange.start
endTime = animationRange.end
with animate on (
for i=startTime to endTime by 10 do (
at time i
d.pos=[0,0,-i]
)
)


Photobucket

read 491 times
10/3/2014 12:07:00 PM (last edit: 10/3/2014 12:07:00 PM)
show user profile  Garp
a = for obj in objects where not obj.isHidden collect obj
a.parent = dummy()


#4 without keyframing: add an expression controller to the dummy's z position track, type -10 * F in the box, evaluate and close.
If you want to go up instead, say, by 3, type 3 * F.
If you want to be at z = 0.0 at frame 50 (so you could move up and down), type 3 * (F - 50).
Etc...




read 488 times
10/3/2014 12:15:41 PM (last edit: 10/3/2014 12:18:42 PM)
show user profile  herfst1
Ooh, almost there. I think I can tweak it though. Right now it works beautifully, but there's a smooth animation from frame 0 to frame 100 going down the z axis by -10. Easily fixed, I think, by changing that number to 1010 (for 101 frames). Or I'm sure there's another solution (or two) to be less of a hack about it. But I like hacking stuff. ;)

You're a champ joez.

[edit] just saw your response Garp. Thank you, I will try it out.
read 487 times
10/3/2014 12:16:20 PM (last edit: 10/3/2014 12:17:29 PM)
show user profile  reeves1984
Does anyone use Python in max yet?

I did more than I ever have in max the other day, it was... interesting... due to lacking documentation. I need to make some notes.

--
Simon Reeves


www.simonreeves.com - VFX Artist & Blog
twitter


www.analogstudio.co.uk <-- I work here

read 462 times
10/3/2014 3:04:28 PM (last edit: 10/3/2014 3:04:28 PM)
show user profile  Nik Clark
I tried to. Couldn't find any docs covering what I needed.




read 460 times
10/3/2014 3:11:05 PM (last edit: 10/3/2014 3:11:05 PM)
show user profile  3joez
Python documentation, anyone?
Photobucket

read 445 times
10/3/2014 4:41:14 PM (last edit: 10/3/2014 4:41:14 PM)
show user profile  mike_renouf
Python documentation. Here you go:

http://en.m.wikipedia.org/wiki/Burmese_python

Sorry. Couldn't resist. It's Friday and brain is fried.




read 423 times
10/3/2014 7:36:57 PM (last edit: 10/3/2014 7:36:57 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org