PDA

View Full Version : move while updating scene


mradfo21
02-11-2011, 06:01 PM
hey guys!

So I'm attempting to essentailly move things around with they keyboard ala a videogame.

one thing i've realised though is that lets say you do a loop when you press a hotkey:

while n pressed:

move object .1 in X

else:

return


and while this can work, unfortunately i don't see an update in the viewport, the object will just appear where i translated it (which makes sense - unfortunately)

does anyone have any ideas? is there a way to basically force the viewport to update? the whole idea is to be able to create fluid movement.

whats funny is if i just sit there with the script editor and hit "enter" 30 times it works just as i'd like.. do you think it'd be smart to try and just.. loop the execution of a script from a function? think that would update the viewport ?

NaughtyNathan
02-11-2011, 08:17 PM
you can force a viewport refresh in a script using the refresh command. However, all other (dynamic) games I've seen running inside Maya use some kind of expressions linked to time and playback (which automatically refreshes the viewport).

you could always check out MELTris or mPac and see how he does it.

http://www.anewhope.se/mel.html

:nathaN

CGTalk Moderation
02-11-2011, 08:17 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.