Script advice?

Next
 From:  Paul (AIRGLASS)
965.1 
Hi Michael,
I'm trying to put together yet another convenience script, but yet again I'm stuck!
The idea is to be able to split an object quickly using a point picked on the object as the cutting location,
generate a line, extrude a plane and use the plane to split the object using boolean diff. (I reused alot of the code from your CSec script). Anyway, every thing works well up until the boolean operation, at which point nothing happens. I'm assuming that I'm not referencing the plane I create correctly, when I use it as input for
Booleanfactory.setInput( 1, Cuttingplane ); , but I have no idea at this point. The cutting plane is set up as var Cuttingplane = PlaneList.item(0); Any advice on what I'm doing wrong?

Thanks,
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
965.2 In reply to 965.1 
Hi Paul, give the attached version a try. You were 99% of the way there, just a couple of quirks at the end - the input to the boolean must be an ObjectList, not an individual object.

Also, another quirk is that the objects used in the boolean have to be added to the geometry database first so they get a unique ID assigned to them.

These are things that I can tune up later, like it would be a convenient thing if a factory could take either an object list or an actual single object interchangably, and the IDs could be assigned automatically in this situation.

This stuff hasn't been quite refined for complete convenience like this yet.

But it seems like the overall "factory" architecture is working out really well, it basically allows you to automate the actual guts behind every regular command.

- 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

Previous
Next
 From:  Paul (AIRGLASS)
965.3 In reply to 965.2 
Hi, Michael,
Thanks for the help -- yes, the more I learn about how MoI commands, etc., work -- the more I appreciate possibilities for scripting commands. The factory mechanism is working out well. I think I'm starting to get the hang of it (at least a little bit :) ).
Now, let's see...... what kind of trouble can I get myself in next!

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:  Paul (AIRGLASS)
965.4 In reply to 965.3 
Hi all,
Here's the final versions of the script I was working on that somebody else might find handy (Thanks to Michael for his help!).
QuickSplit_XYZ cuts an object along an axis defined on the
script command line.
To set it up: add the script to the moi/commands directory,
hook it up to a hotkey in MoI's options dialog, with the script command
< QuickSplit_XYZ X (or Y or Z)>, separate the parameter by a space
from the command. To use: pick an object, hit your hotkey, and pick a cutting
location on the object. It will be split at that location
along the specified axis.
QuickSplit_Angle works the same way, no parameters needed, but will split
an object along an angled line defined by 2 picked points. (pick the object,
hit your hotkey, pick 1st point, pick 2nd point, object is cut.)
Both scripts are intended for use in the Top, Front, and Right viewports.

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:  Frenchy Pilou (PILOU)
965.5 In reply to 965.4 
Can you put an image of this new function with an object before / after ?
---
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)
965.6 In reply to 965.5 
Hi Pilou,
Imagine a cube sliced into 2 parts by the script. That's all it is, just a quick convenience function to slice and dice an object up real fast. One use for it is if you have a model with internal parts and want to get a quick look at something inside - split the model, take a quick look, hit undo and you're back to where you started. Another use might be to make a quick cross-section of a model or to chop a section out of a model by splitting the model in 2 places and deleting the section.
Hope that helps!

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)
965.7 In reply to 965.6 
Thx for the explanation
I will try it :)
PS You have not written what we must write for the Angle in column of the Shortcut

Pss an you must write for the first for example
Alt+X QuickSplit_XYZ X
Alt+Y QuickSplit_XYZ Y
Alt+Z QuickSplit_XYZ Y

becauce I have written QuickSplit_XYZ X (y or Z) and nothing work !!! :)
---
Pilou
Is beautiful that please without concept!
My Gallery

EDITED: 30 Sep 2007 by PILOU

  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)
965.8 In reply to 965.7 
Hi Pilou.
"because I have written QuickSplit_XYZ X (y or Z) and nothing work !!! :)"
Good point! :) I should have been more clear -- it's:
QuickSplit_XYZ X
QuickSplit_XYZ Y
QuickSplit_XYZ Z

For the Angle script there is no parameter to enter. The angle is chosen by where you place your 2 points on the model.

Paul

PS --
After playing around with QuickSplit_Angle for awhile I realized Pilou was thinking "angle as defined by a specified angle". Turns out there is a way to do that with this script:
Pick your object, hit your hotkey, pick the location you want the split to run thru, go to the angle box at the bottom of the gui and enter a number for the amount of precision you need for the angle, that turns on snapping set to that precision. Then pick your 2nd point on the model, after moving the pointer around until you get the angle you want. The split will be done at the specified angle. In other words, if you want a split at 45 degrees, enter 5 in the angle box and snapping will happen at increments of 5 degrees. If you want 22.5 degrees, type in 0.5, snapping sets to 0.5 degree increments.
The more I use MoI, the more I realize how well thought out Michael's design is!

EDITED: 30 Sep 2007 by AIRGLASS

  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)
965.9 In reply to 965.8 
That works fine :)
But I dont understand why you have 2 scripts?
Split_Angle with Snap Direct enable can make the same than QuickSplit_xyz (and more of course) :)
So I have erased QuickSplit_xyz and keept Split_Angle who is very useful indeed :)
---
Pilou
Is beautiful that please without concept!
My Gallery

EDITED: 30 Sep 2007 by PILOU

  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:  Paul (AIRGLASS)
965.10 In reply to 965.9 
Yes, I realized that too, after I used it awhile.
The Angle script is all that's needed. :) Oh, well, learned a little more about MoI's scripting in the process...

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
 

Reply to All Reply to All