Is there a way to quickly hide / show controls...?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Search this Thread Display Modes
  03 March 2014
Is there a way to quickly hide / show controls...?

Specifically, I'm looking to set up some kind of quick keys to show / hide all the various elements in the viewport. I realize that I can go up to the "filter" menu and either hit "ALL" or "NONE" - however, that doesn't really do it, because I normally like to have certain of those options off all the time, and when I toggle "ALL" then those items get turned on by default.

I guess, what I'm after, is something like "COMMAND + SHIFT + H" in AfterEffects.

Anyone?

Thanks!
 
  03 March 2014
I'm going to simplify my question. Forget all the items in the "filter" menu in the viewport. All I want / need to do is find a quick way to toggle on or off the "Sel: Wireframe" from the Display menu for the viewport. That would be great!
 
  03 March 2014
Script it!

For example I use this to toggle the display of splines and nulls (typically controllers in character rigs).

Here's the code (COFFEE). The '!' means 'not' in COFFEE so it toggles. You should be able to adapt this for what you need I guess.


var draw = doc->GetActiveBaseDraw();
if(!draw) return;


draw#BASEDRAW_DISPLAYFILTER_NULL = !draw#BASEDRAW_DISPLAYFILTER_NULL;
draw#BASEDRAW_DISPLAYFILTER_SPLINE = !draw#BASEDRAW_DISPLAYFILTER_SPLINE;
 
  03 March 2014
Hi, I agree with Horganovski, you can paste this in a new python script, save it and dock it in the layout (or assign an hotkey):

import c4d
from c4d import gui

def main():
    bd = doc.GetActiveBaseDraw()
    filter_state = bd[c4d.BASEDRAW_DATA_WIREFRAMESELECTION]
    if filter_state == 1:
        bd[c4d.BASEDRAW_DATA_WIREFRAMESELECTION] = 0
    else:
        bd[c4d.BASEDRAW_DATA_WIREFRAMESELECTION] = 1   
    c4d.EventAdd()
if __name__=='__main__':
    main()


this should toggle Sel. Wireframe on or off. Horganovski code is more elegant though
__________________
www.visualtricks.it - www.c4dzone.com
 
  03 March 2014
Guys, thank you SO much. I'll give both script options a shot, and see if I can weed my way through.

Cheers!
 
  03 March 2014
Wow I can't believe I've ignored COFFEE and Python for so long. 3 years into using C4D and I'm constantly surprised at how malleable it is. I had no idea you could drag just about any command or optionbox into the ScriptManager to mess around with it.

The homework never ends now I'm spending the weekend reading up about COFFEE.

Thanks Horganovski and Visualtricks!
__________________
-willRyan
 
  03 March 2014
Originally Posted by WillRyan: Wow I can't believe I've ignored COFFEE and Python for so long. 3 years into using C4D and I'm constantly surprised at how malleable it is. I had no idea you could drag just about any command or optionbox into the ScriptManager to mess around with it.

The homework never ends now I'm spending the weekend reading up about COFFEE.

Thanks Horganovski and Visualtricks!


Glad it helps! I'd recommend learning Python over COFFEE though as COFFEE seems to be pretty much dead in terms of development, I don't think there have been significant updates to it in years. The Python docs are kind of poor in my opinion (they need a lot more examples for one thing like the docs for other apps, ahem!) but worth persevering with as Python seems to give you better access to the workings of C4D.

Cheers,
Brian
 
  03 March 2014
Thanks Brian there are so many places to learn Python online. Do you have a place you would recommend to start training, with a particular focus on getting up to speed with how to use it best in Cinema 4D?
__________________
-willRyan

Last edited by WillRyan : 03 March 2014 at 11:24 PM.
 
  03 March 2014
Cineversity has some good tutorials on it, and there is a wiki there that has a lot of useful tidbits of code.

When you wrap your head around how the classes work, it gets easier.

I'd recommend just finding scripts(grab any of the ones on my website) and start picking apart the code(hopefully I commented them).
__________________
www.bretbays.com
"We do not - not wag our genitals at one another to make a point!"
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:36 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.