Can you script modeling functions?

Next
 From:  NCEL (NCELIKGIL)
1005.1 
Can you script modeling functions like revolve? In other words when you pick an object it automatically revolves the object with a default axis? Or to automatically generate a certain shape like a helix or some other mathematical objects that are preset according to coordinates in the script? Or does the scripting feature strictly control just the UI?
  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)
1005.2 In reply to 1005.1 
Hi Nuri,
I think it's possible, using the commands available in the moi/commands directory. I believe you should be able to generate any object you want using a script. Michael would know more, tho --

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
1005.3 In reply to 1005.1 
Hi Nuri, it is possible but it can be kind of difficult to do right now since there is no documentation for it.

Like Paul mentions, you can check out the scripts in the \commands subdirectory to see how they work.

At the heart of each command is a factory. The factory takes inputs like a point, an object list, a number, etc.. , and then creates its output object when you call factory.commit().

Normally a command script does a bunch of work to gather up input data from the UI and then feeds that data into the factory inputs. But it is possible to create a command script that feeds your own custom data into the inputs instead of getting it from any UI. It sounds like that is what you are looking for.

For revolve for example, if you look at Revolve.js you can see that it is setting 5 inputs on to its factory. Input 0 is an object list for the curves to revolve, Input 1 is the start point of the axis, Input 2 is the end point of the Input 3 is the revolution angle, and Input 4 is a boolean for whether to cap ends or not.

The revolve command asks you to draw a line segment and then uses that to fill in the axis points on the factory. But you could make a custom "FixedRevolve.js" command file that skipped the line drawing step and just filled in your specific points.

- 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
 From:  NCEL (NCELIKGIL)
1005.4 In reply to 1005.3 
Thanks Michael,

Yep, I want to generate objects like certain primitoves on the fly
Thats sounds like a great thing to toy around with....I have never seen such a flexible interface....I have to try some of these.
  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