Author Topic: [RESOLVED] 3ds Max hide / unhide - toggle visibility  (Read 16678 times)

2020-04-29, 09:45:27

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
I've searched this many times before and never found anything.

Is there a way to bind a hotkey to simply hide / unhide objects in Max? For example, I have three boxes (A,B,C): I select A, press 'H', object A is hidden, I press 'H' again, object A is not hidden; objects B and C are not directly affected by the operation.

« Last Edit: 2020-04-29, 12:24:14 by cjwidd »

2020-04-29, 11:48:10
Reply #1

Bormax

  • Active Users
  • **
  • Posts: 568
    • View Profile
Hi
You can assign hot key in Customize User Interface dialog to Hide Selected (or by Name/Hit) and Unhide by name commands

2020-04-29, 11:57:52
Reply #2

Frood

  • Active Users
  • **
  • Posts: 1903
    • View Profile
    • Rakete GmbH
Hmm, it would be inconvenient to be forced to remember the names of all objects :]. But fortunately things like this are very quickly scripted (throw it into usermacros directory, then find it in category "cjwidd").


Good Luck


Edit: removed old script
« Last Edit: 2020-05-08, 20:51:02 by Frood »
Never underestimate the power of a well placed level one spell.

2020-04-29, 12:06:53
Reply #3

Bormax

  • Active Users
  • **
  • Posts: 568
    • View Profile
Hmm, it would be inconvenient to be forced to remember the names of all objects :]. But fortunately things like this are very quickly scripted (throw it into usermacros directory, then find it in category "cjwidd").


Good Luck

Nice script Frood! Thank you! One more very useful tool from you! I would name this script "Magic pocket" ;)

2020-04-29, 12:23:13
Reply #4

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
This is beautiful @Frood, thank you so much! ❤️

2020-04-29, 12:32:16
Reply #5

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
@Frood quick question about modifying the script to support serial selection:


2020-04-29, 14:34:04
Reply #6

Frood

  • Active Users
  • **
  • Posts: 1903
    • View Profile
    • Rakete GmbH
Haha, thank you both :) Yes, that "additive" feature is doable easily.

The "pressed" state of a button usually means in any UI that you would release it when pressing it again - reverting it's functionality. So this is not exactly a nice and consistent side effect to be able to press it again, but useful for sure. Of course, if assigning the script just to a hotkey you will never notice anyway.


Good Luck


Edit: removed old script
« Last Edit: 2020-05-08, 20:50:53 by Frood »
Never underestimate the power of a well placed level one spell.

2020-04-29, 18:56:14
Reply #7

Bormax

  • Active Users
  • **
  • Posts: 568
    • View Profile
Haha, thank you both :) Yes, that "additive" feature is doable easily.

The "pressed" state of a button usually means in any UI that you would release it when pressing it again - reverting it's functionality. So this is not exactly a nice and consistent side effect to be able to press it again, but useful for sure. Of course, if assigning the script just to a hotkey you will never notice anyway.


Good Luck

Thank you! That's great!

2020-04-29, 21:48:28
Reply #8

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
@Frood This is really great, thank you so much for your help! I recorded a short video clarifying exactly what I was trying to implement, but I think your most recent (additive) version is probably the best case scenario. I'm just curious what your thoughts are (see below):


2020-04-29, 22:55:25
Reply #9

Bormax

  • Active Users
  • **
  • Posts: 568
    • View Profile
One note about the script functioning:
If selected object has active sub-object mode in Modifier section, then Hide/Unhide button/hot key hides the object, but doesn't unhide it back if you press it second time. This object could be found in the list of hidden object (Unhide by name), but your magic button/hot key unfortunately doesn't bring it back to screen

2020-04-30, 12:04:31
Reply #10

Frood

  • Active Users
  • **
  • Posts: 1903
    • View Profile
    • Rakete GmbH
@cjwidd: You are good at advertising even the mundanest things: calling a 20 lines script written + quickly tested in 10-15 minutes to be a "developed" one is a rhetorical masterpiece :) As for your question(s): If I understand it correctly, you would just be able to unhide objects when they are selected (using the scene explorer for example) with one and the same hotkey/button. Yes this is possible but requires more scripting (=iterating through objects and test every one). And it's like you suspected: using the eye icon in the case you showed would be the preferred way in my opinion. The benefit of a script like this would be that you even don't need to have a scene explorer open.

But testing every object may be required anyway because you can simply let it fail by deleting an object hidden by this script. It's possible to catch that error but it would result in having only parts of the objects unhidden. I cannot judge the speed impact, currently 10.000 objects are processed very quickly because there are no (scripted) loops. I will test betimes.

@Bormax: Thank you, I know why it happens. Seems you cannot use "select none" when in subobject mode - but you can select another object and then use "select none". Well, great... I don't know if there is any workaround. In the worst case, subobject level has to be left, let's see.


Good Luck



Never underestimate the power of a well placed level one spell.

2020-04-30, 12:26:55
Reply #11

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
@Frood Just want to show my appreciation - it means a lot that you took the time to help. Thank you 🙂

2020-05-08, 20:49:16
Reply #12

Frood

  • Active Users
  • **
  • Posts: 1903
    • View Profile
    • Rakete GmbH
Just picking up stuff which I would find useful for myself. Try attached one, should handle the mentioned issues (category "Rakete" this time, since it's just a copy from my local script).


Good Luck


Edit: Added screen redraw, in some scenes the viewports did not update.
« Last Edit: 2020-05-15, 09:32:44 by Frood »
Never underestimate the power of a well placed level one spell.

2020-05-09, 00:15:57
Reply #13

Bormax

  • Active Users
  • **
  • Posts: 568
    • View Profile
Just picking up stuff which I would find useful for myself. Try attached one, should handle the mentioned issues (category "Rakete" this time, since it's just a copy from my local script).


Good Luck

Great! It works perfectly. Thank you very much!

2020-05-09, 00:37:05
Reply #14

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
@Frood Very nice, thank you :)