Welcome to CGarchitect.com Untitled Document

Go Back   CGarchitect.com > 3D SOFTWARE > Scripts

Notices

Scripts Post and discuss architectural scripts or maxscripts here. This forum is for all software applications.

Reply
 
LinkBack Thread Tools Display Modes
Old April 12th, 2007   #1 (permalink)
Senior Member
 
Join Date: Nov 2006
Location: Currently in Shanghai
Posts: 197

Name: Elliott Hambrook


China  Send a message via MSN to batteryoperatedlettuce


Default script - auto animate rotation

This is the first script I ever wrote in max script after seeing an arch viz animation featuring a building "being built" by lots of rotating slabs.

I wanted to do something similar for some pathing I was doing at the time and decided to learn max script. Feel free to have a play with it. I'm spending today writing it as an object modifier. Any suggestions for interaction would be welcome.

The script requires one camera named camera01 and rotates every object in the selection 180 degrees one after the other, within a given number of frames, ordered based on their distance from camera01

Code:
 
oA=for i in $selection collect i
fn cF v1 v2 =
(
local d = (distance v1.pos $camera01.pos)-(distance v2.pos $camera01.pos)
case of
(
(d < .0): 1
(d > .0): -1
default: 0
)
)
qsort oA cF 
for p in oA do print p
global nF = 200;
global nO = oA.count;
global inc = nF/nO;
global sT = 0;
global eT = inc;
global iR = eulerangles 0 0 0;
global rB = eulerangles 0 180 0;
animationrange = interval 0 nF;
rotate selection rB;
for i in oA do
(
animate on
 (
 at time sT (rotate i iR)
 at time eT (rotate i rB)
  )
 sT = sT + inc;
 eT = eT + inc;
)

Last edited by batteryoperatedlettuce; April 12th, 2007 at 12:08 AM.
batteryoperatedlettuce is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links

Old April 12th, 2007   #2 (permalink)
Senior Member
 
Join Date: Aug 2004
Location: Johannesburg
Age: 33
Posts: 309

Name: Arnold Sher


South Africa  Send a message via Skype™ to arnold@asylumstudio.co.za


Default Re: script - auto animate rotation

just tested your new toy and it is a lovely script... looking forward to your follow up...
arnold@asylumstudio.co.za is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 12th, 2007   #3 (permalink)
Senior Member
 
Join Date: Nov 2006
Location: Currently in Shanghai
Posts: 197

Name: Elliott Hambrook


China  Send a message via MSN to batteryoperatedlettuce


Default Re: script - auto animate rotation

Thanks, feel free to play. I have plans to pack a few of my scripts into something more user friendly. At the moment they are just a bunch of glorified keyboard shortcuts designed to speed modeling and extend my coffee breaks.

It's quite addictive, I'm hooked at the moment on a script for automating the animation of characters playing instruments based on midi and tab data from tab music files. Not sure how useful that will be to the cg/arch viz community but I'll post it if I ever get it finished

Last edited by batteryoperatedlettuce; April 12th, 2007 at 09:18 PM.
batteryoperatedlettuce is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
script: Camera Animator quizzy Scripts 9 November 7th, 2007 03:08 AM
Max Script..... hmahesha Scripts 3 March 9th, 2007 06:11 AM
Rendering large images - what's the script? Rick Eloy 3ds Max 13 May 31st, 2006 12:46 AM
script: Random material ID quizzy Scripts 2 April 22nd, 2006 03:04 AM
script: Auto Calc Areas nuno Scripts 1 August 21st, 2002 07:07 PM


All times are GMT -7. The time now is 12:14 AM.





Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
© Copyright 2001 – 2008 CGarchitect Digital Media Corp. All Rights Reserved.