Protect style from unhide all

Next
 From:  Andre
9677.1 
I guess this is kind of a feature request, but if there's a good workaround of course I'd like to here it.

When modeling I often want to keep old versions of objects, like solids before cutting or the source curves for loft/sweep/network. What I usually do is, I create an "Archive" style, assign those old object to that style and hide the style.

However, whenever I click the hide button with nothing selected to unhide objects, of course these "archived" objects get unhidden, too. I do that a hundred times: Unhide all, hide archive style, do something else, hide something, do something else, unhide all, hide archive style, and so on.

It would be nice if there was a checkbox in the "Edit style" dialog like "Protect from 'Unhide all'" which, when enabled, causes this particular style not to be unhidden when I unhide all objects.

To use the objects from the archive style, it should still be possible to unhide the style by directly clicking its "eye" icon.
  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
9677.2 In reply to 9677.1 
Hi Andre, re:

> It would be nice if there was a checkbox in the "Edit style" dialog like "Protect from 'Unhide all'" which,
> when enabled, causes this particular style not to be unhidden when I unhide all objects.

I can see how that would be useful, but the general thing that I don't like about these kinds of special override modes is it can lead to great confusion when someone else is trying to look at your file.

How about a script that you could set up on a shortcut key that will do a "Show all except Style=Archive" when you push the shortcut key, would that help?

If so give this one a try:

script: /* Show all except Style=Archive */ var index = -1; var style = moi.geometryDatabase.findStyle( 'Archive' ); if ( style ) index = style.index; var objs = moi.geometryDatabase.getObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); if ( obj.hidden && obj.styleIndex != index ) { obj.hidden = false; obj.getSubObjects().setProperty( 'hidden', false ); obj.selected = true; } }

- 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:  Andre
9677.3 
That works nicely. :)

I have even added it to SidePane.htm:

<td><moi:CommandButton icon="icons/UnHideIcon.png" onclick="/* Show all except Style=Archive */ var index = -1; var style = moi.geometryDatabase.findStyle( 'Archive' ); if ( style ) index = style.index; var objs = moi.geometryDatabase.getObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); if ( obj.hidden && obj.styleIndex != index ) { obj.hidden = false; obj.getSubObjects().setProperty( 'hidden', false ); obj.selected = true; } }">Unhide all<br>except Archive</moi:CommandButton></td>



Image Attachments:
Size: 6.1 KB, Downloaded: 11 times, Dimensions: 64x64px
  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:  Karsten (KMRQUS)
9677.4 In reply to 9677.3 
Hello Andre,

my favorite script for managing this:

http://kyticka.webzdarma.cz/3d/moi/#HideSwap

have a nice day
Karsten
  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:  Stargazer
9677.5 
I also had this problem. Very useful!

Is it possible to make this script to hide stuff when somthing is selected? this way I can replace it with the default Hide/Unhide command.


Thanks!
  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
9677.6 In reply to 9677.5 
Hi Stargazer,

re:
> Is it possible to make this script to hide stuff when somthing is selected? this way I can replace it with the default Hide/Unhide command.

Try this:

script: if ( moi.geometryDatabase.getSelectedObjects().length > 0 ) { moi.geometryDatabase.hide(); } else { var index = -1; var style = moi.geometryDatabase.findStyle( 'Archive' ); if ( style ) index = style.index; var objs = moi.geometryDatabase.getObjects(); for ( var i = 0; i < objs.length; ++i ) { var obj = objs.item(i); if ( obj.hidden && obj.styleIndex != index ) { obj.hidden = false; obj.getSubObjects().setProperty( 'hidden', false ); obj.selected = true; } } }

- 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:  Stargazer
9677.7 
Thank you so much!!
  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:  AlexPolo
9677.8 
Great Script - where are the default styles kept so I can add the ARCHIVE style in?
  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
9677.9 In reply to 9677.8 
Hi Alex, you can alter the default styles by setting up styles how you want in a .3dm file and then specifying that .3dm file as the startup template under Options > General > Template file.

- 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:  AlexPolo
9677.10 
thanks again 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
 

Reply to All Reply to All