AutoRotate script final  1-20  21-24

Next
 From:  Paul (AIRGLASS)
1001.1 
Hi all,
Here's the final version of the AutoRotate script I posted last week --
This one has a small gui to manipulate the model rotation :
a slider to change rotation speed, direction buttons, and start/stop buttons.
There are no command line parameters, so to set it up, stick the files in the moi/commands directory,
open MoI, go to Options/Hotkeys, add a new entry:
R AutoRotate2
and that should do it!

Paul
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
1001.2 In reply to 1001.1 
Very cool that you're able to leverage different UI controls now!

I hope you are having fun tinkering with this, it can be fun thinking of how you want something to work and making it do exactly what you want.

Hopefully when I get some more time to work on it I can make it possible to hook up a debugger to the script, right now when you are developing a script it can be hard to debug it.

Let's see a couple of comments - in this case I think you can leave off the display:none on the parts of the UI, and just skip the beginUIUpdate() / showUI() / endUIUpdate() stuff. That stuff is meant for commands that have different stages in the command and show different prompts and different UI controls at each stage. That beginUIUpdate() / endUIUpdate() thing is there to batch up a bunch of shows and hides into one atomic operation to avoid flickering. Because the command script runs on its own thread independent of the main program it is possible for there to be stuff like redraws between each line of script being run.

The only other thing other than that, is I think that the speed of rotation for this may be machine dependent, on a fast machine where the script is able to loop faster and the redraw is faster, it may whiz around pretty rapidly... One thing that might alleviate that would be to run the actual rotate in the .htm <script> instead of the actual command .js file - maybe something like a Start() and Stop() function in the .htm file, and have Start() call the HTML window.setInterval() to call a Rotate() function at periodic timed intervals, with Stop() calling window.clearInterval(). Being based off of a timer interval would make for more consistent speed on different machines. But you already have the slider to change the speed so that may not be necessary.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Paul (AIRGLASS)
1001.3 In reply to 1001.2 
Yes, it is fun playing with MoI's scripting once in a while - this little script has turned into a good learning tool for figuring out how to customize MoI. The way you've got it all designed, the possibilities are pretty wide ranging - it wouldn't surprise me to see someone at some point in the future implement a completely different, customized, gui and function set for MoI, (not me tho :) )
Thanks for the comments, Michael, I think I'll play around a bit with your suggestions this evening.
I was kind of wondering about the effect of machine speed on the rotation loop, my current machine is an old PIII 866 and the rotation goes plenty fast on it, but like you say, a faster machine would probably spin a model like a top!
One sort of interesting side effect of auto rotating a model is that the model rotates in one direction if it's centered in the middle of the viewport, but if you pan it off to the side, the perceived rotation reverses, because the whole viewport is actually rotating - sort of a fool-the-eye effect!

Paul
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
1001.4 
Terrific!
The magic of this new thing is that works fine! :)
Even with the another function enable during the process like "full screen" or zoom with the wmouse wheel !
Bravo!
A new modular system of adding function script is born :)
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Paul (AIRGLASS)
1001.5 In reply to 1001.4 
Hi Pilou,
Yea I noticed that too. It appears that while at least some scripts are running, other functions continue to work, like reset, zoom ,pan, etc. Pretty cool, eh!

Paul
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael T. (MICTU_UTCIM)
1001.6 
Hello to all!
I have a lot of modeling time logged in alot of CAD/Modeling programs (MoI ROCKS! by the way) but zero knowledge for scripting, programming etc. Are ther tutorials or stuff "For Dummies" to get started in these areas?

Any help is appreciated.
Michael Tuttle a.k.a. mictu http://www.coroflot.com/fish317537
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Paul (AIRGLASS)
1001.7 In reply to 1001.6 
Hi Michael,
Here's what appears to be a decent beginning tutorial/reference in Javascript :
http://www.webreference.com/programming/javascript/diaries/
with more links on this page:
http://www.webreference.com/programming/javascript/
This is the first time I've used javascript and it seems fairly easy to pick up (tho I've done some programming years ago in C and bash shell, so that helps). It looks like there's no memory management stuff to deal with, variables don't need to be typed, so javascript is probably a good place to start and it applies to MoI.
Hope that helps a little ---

Paul
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
1001.8 In reply to 1001.6 
< but zero knowledge for scripting, programming
it's a hard way and very consuming time learning curve from zero ;)

You must learn syntax, mechanism, algorithmic...

Scripting is more easy than programming

In any case make that only for the pleasure ;)

Only kids who have begun precociously are like fishes in water with this area of science :)
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael T. (MICTU_UTCIM)
1001.9 
Thanks Paul & Pilou!

How about MoI specific scripting?
Michael Tuttle a.k.a. mictu http://www.coroflot.com/fish317537
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
1001.10 In reply to 1001.9 
Hi Michael - there aren't yet any tutorials about scripting in MoI.... I haven't even finished the tutorials for how to just use it regularly yet! :)

Petr and Paul have learned how to do it just by looking through the scripts that come with MoI. Every command in MoI has a script that controls it, you can find them under the \commands subfolder under MoI's main folder in \Program Files.

At some point in the future I would like to work on some documentation for doing scripting inside of MoI, but it takes quite a bit of time to do this type of documentation and if I focused on that it would mean that I would have to postpone working on some modeling features. For now I have put working on new modeling features at a higher priority.

I think it might not be until version 3.0 that I really get a chance to do some more work on stuff for customizing MoI.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Paul (AIRGLASS)
1001.11 In reply to 1001.10 
Michael explains it better than I can! :)

Paul
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael T. (MICTU_UTCIM)
1001.12 
Okay. Thanks again everyone!
Michael Tuttle a.k.a. mictu http://www.coroflot.com/fish317537
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael (ORION20036)
1001.13 In reply to 1001.1 
Hello Michael, is it possible to get the script to loop for more than one revolution, as it would be very handy to do a screen video capture with some of my sculptures, not really that savvy with javascript.

EDITED: 1 Feb 2013 by ORION20036

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  coi (MARCO)
1001.14 In reply to 1001.13 
hey michael..

that's already the case, at least on my system(win7 64). did you use the autorotate2 script?



~ marco
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael (ORION20036)
1001.15 In reply to 1001.14 
Sorry, I should have said more than one revolution without the slight pause. I am using the AutoRotate2 script.

EDITED: 1 Feb 2013 by ORION20036

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael (ORION20036)
1001.16 In reply to 1001.15 
I posted a few weeks ago relating to being able to modify the AutoRotate2 script to loop more than one time so I can do a screen video capture. The script does turn indefinitely, but has a slight pause with every revolution. Any information on how to modify the script so I can set the number of continuous revolutions without a pause would be appreciated.

I use animation lab with Turbocad, but like the moi rendered version for a quick visual look around of my model, as it is so simple and also fast, plus great for YouTube.

Any help appreciated.


Thank You!.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mcramblet
1001.17 
Paul-

Thanks for posting this, it works great. I'll have to find a decent Mac OS screen capture program so I can use the script and capture quick animations right out of MoI. Very useful!

Michael Cramblet
Packaging Design
Phone: 616-574-6271
 
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
1001.18 In reply to 1001.16 
Hi Michael (ORION20036) - you wrote:

> The script does turn indefinitely, but has a slight pause with every revolution. Any information
> on how to modify the script so I can set the number of continuous revolutions without a pause
> would be appreciated.

It looks like the script currently runs on a "busy loop" where the script is going in a really tight loop kind of continuously churning away. I'll try to modify it to use a timer instead and move more processing over into the main host process. I think that could make for some more consistent motion.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael (ORION20036)
1001.19 In reply to 1001.18 
Many thanks Michael, It has great potential for viewing my Cad Sculptures, especially as it is so simple to capture, and your rendering settings are just perfect.


Many thanks for posting the script also Paul!.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
1001.20 In reply to 1001.19 
Hi Michael, try the attached updated version, this one is kind of "lighter weight" since it doesn't make the script run in a continuous busy loop and that should likely help it have a more consistent motion.

This version will only run on v3 (or v2.5 on the Mac should be ok too).

Hope this helps!

- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
Show messages:  1-20  21-24