Hide Grid? - Shortcut

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
  08 August 2017
Hide Grid? - Shortcut

Hello guys.
I started working recently on Cinema4d. I'm thinking of migrating to it after 18 years working with 3d Studio Max. I'm really enjoying Cinema4d.

But it has a simple functionality that I can not configure in Cinema4d. I would like to create a shortcut key for the command:
Grid - Enables / Disables the grid display.

I already checked the documentation and found that it is not possible to assing a shortcut key for this command. By searching the CGtalk Forum, I discovered a script that would do this ...
The problem is that the script is very old and currently in version R17 is not working ... Could you tell me why? Maybe someone around understands scripts better.

The script suggested by CGtalk is this:
Var doc = GetActiveDocument ();
Doc-> GetActiveBaseDraw () # BASEDRAW_DISPLAYFILTER_GRID =
! Doc-> GetActiveBaseDraw () # BASEDRAW_DISPLAYFILTER_GRID;

Thank you for your attention!

(the original topic is this: http://forums.cgsociety.org/archive...?t-421997.html#)
 
  08 August 2017
Hey… I have this set up as a script which I've mapped to a key command… The script I'm using is as follows…

doc->GetActiveBaseDraw()#BASEDRAW_DISPLAYFILTER_GRID =
!doc->GetActiveBaseDraw()#BASEDRAW_DISPLAYFILTER_GRID;

I named my script Toggle Grid and it appears in the Customise Commands manager, which you can then select and map a key to…
 
  08 August 2017
Try this:

main(doc,op)
{
var doc = GetActiveDocument();
doc->GetActiveBaseDraw()#BASEDRAW_DISPLAYFILTER_GRID =
!doc->GetActiveBaseDraw()#BASEDRAW_DISPLAYFILTER_GRID ;
doc->GetActiveBaseDraw()#BASEDRAW_DISPLAYFILTER_HORIZO N =
!doc->GetActiveBaseDraw()#BASEDRAW_DISPLAYFILTER_HORIZO N;
}

I have C4D R.18 and it's working. (BTW I found this on CGSociety forum as far as I can remember).
 
  08 August 2017
Originally Posted by yCekyLL: The problem is that the script is very old and currently in version R17 is not working ... Could you tell me why? Maybe someone around understands scripts better.

The script suggested by CGtalk is this:
Var doc = GetActiveDocument ();
Doc-> GetActiveBaseDraw () # BASEDRAW_DISPLAYFILTER_GRID =
! Doc-> GetActiveBaseDraw () # BASEDRAW_DISPLAYFILTER_GRID;


Well, as for the "why": COFFEE is case sensitive. So, first "Var" needs to be "var". Second, you define "doc" but use "Doc". If you go with small letters in both cases, it works fine (and actually the original link has it that way...)

For further reference: "doc" is a predefined variable, so you can go without the first line altogether and just use the single command in the second and third line.

If you start with the "main" function, "main(doc,op)" already contains "doc" as a parameter too, so you won't need to define the variable again, or set it. Note that everyEnd's code also gets garbled by CGSociety's formatting: there is a whitespace in "HORIZO N" which should not be there.
 
  08 August 2017
Oh, and of course this is COFFEE code, not Python - Python is preselected in the Script Manager so you will need to switch to COFFEE before you use the editor.

And you may want to open the Console that shows errors for the scripts, to get more information when a script just doesn't work.
 
  08 August 2017
Hi, i made these some times ago, to toggle camera, lights and grid filters..if you want to check em out:
https://www.dropbox.com/s/ryqgs182h...ilters.zip?dl=0
__________________
www.visualtricks.it - www.c4dzone.com
 
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 02:26 AM.


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