Selection script
All  1-11  12-19

Previous
Next
 From:  Paul (AIRGLASS)
1078.12 
Here's a variation on the CycleSelect script mixing it in with Petr's SelectByType script.
To use:
Select an object in a viewport (a brep, curve or point object), hit the hotkey you've assigned
and that type of object will be selected in sequence (once per keypress). If no object is selected first, or more than one is selected, a reminder will pop up; press Done; do a selection and rerun the script.

hotkey CycleSelectByType
Alt+hotkey CycleSelectByType Back

Petr, I tried to work in subobject selection, but apparently it's not currently possible, unless I've misunderstood, anyway nothing I tried worked -

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
1078.13 In reply to 1078.12 
Hi Paul, back a little bit ago I added a couple of script methods for getting sub objects. It should work if you have the latest patch.

I attached an updated moi.idl here.

There are 2 ways that will work - for any object you can now call the new getSubObjects() method on the object which returns an object list of all sub-objects underneath the object. But one tricky thing is this includes curve segments which are sub-objects of a curve as well, you should probably skip the segments since most things don't currently expect a segment sub-object to be selected, things expect just the parent curve (edge curve or standalone curve) to have the selection instead.

Another thing you can use is on a brep object, there are getEdges() and getFaces() methods that will let you get those as object lists. This one may be easier since it won't include segments.

- 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:  Marc (TELLIER)
1078.14 
This scripts looks great Paul!

Maybe it is a known issue but just for the record I found out that you cannot assign the equal ( = ) and bracket keys ( [ ] ) to a shortcut as they seem to interfere with the scripting language. (They work with modifiers though.)

-"Currently there isn't any way to target "edit points"

I would thought it possible since selections of multiple points can be manipulated with many of the transform tools and also align.

Regards,

Marc

EDITED: 2 Nov 2007 by TELLIER

  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)
1078.15 In reply to 1078.13 
Hi Michael,
Thanks for newer .idl. I'll take a look at it this weekend and see if I can rework the script. I'll get it right sooner or later! :)

Paul

Ps
Marc, yes, there are a few keys that won't work as hotkeys,
like Tab, semicolon and apostrophe that I know about, not sure about the others--

EDITED: 2 Nov 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:  Michael Gibson
1078.16 In reply to 1078.14 
Hi Marc & Paul,

Marc wrote:
> Maybe it is a known issue but just for the record I found out that you cannot
> assign the equal ( = ) and bracket keys ( [ ] ) to a shortcut as they seem to
> interfere with the scripting language.

Actually I didn't know about this, thanks for reporting it!

What is happening here is the = and bracket keys interfere with the structure of the moi.ini file where the shortcut keys are saved, since [] is used for a [section name] in the ini file, and the = is used for an entry like name=value.

Definitely avoid using these for now, they can trigger some bugs that may kind of mess up your moi.ini file.

Also semi-colon is used as a comment in the .ini file, so that's why that one doesn't work as well.

I've fixed these up for the next release, these characters will be escaped when written to the moi.ini file to fix these problems.

I've also added in the Tab key as something you can assign shortcuts to.

Thanks!
- 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)
1078.17 
Finally got around to finishing the cycle select script with subobject selections. Cycling the selection thru all objects (depending on what's selected) should work now. Useage (with command line parameters) :

hotkey CycleSelectByType

Alt+hotkey CycleSelectByType Back

hotkey CycleSelectByType TopLevel

hotkey CycleSelectByType AllOfType

The TopLevel parameter will cycle selection thru all objects except faces and edges --

The AllOfType parameter will cycle thru points, breps, faces, and curves (except edges), depending on the type of object initially selected --

The Back parameter can be used with the other two parameters, as in:
CycleSelectByType TopLevel Back

If no object is selected before the script is run, a notice will pop up, click Done, make a selection, rerun the script.

One problem with this script is that on larger models with alot of objects, the edge and face cycle selection can be very sluggish, due to the way I've got the script designed.
Thanks to Michael and Petr for their help!


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:  tyglik
1078.18 In reply to 1078.12 
Hi Paul,

I put an idea how command should work on the paper last week when I was going a long way by train and managed to spare time to rewrite it today. The custom command just mixes all known macro scripts together, so the code isn't very clear... if else if else... I am still genuinely surprised it works :)
I am posting it in a separate thread... and trying your piece of work... fine. Moi's cryptic scripting is funny, isn't it :) But pretty time-consuming - making a model is much better.

Petr
  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)
1078.19 In reply to 1078.18 
Hi, Petr,
>The custom command just mixes all known macro scripts together <
Now you've got me curious! Petr's All_In_One_Super_Duper script !
If else, if else, if else --- Yup, I hear ya on that, like figuring out a big puzzle :)
But, I've learned alot in the process, it's kind of handy to be able to make a custom command once in awhile,
time to get back to doing some actual modeling for a change --)

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

 

 
 
Show messages: All  1-11  12-19