Shortcut for Layouts?

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
Old 04 April 2017   #1
Shortcut for Layouts?

Hi!

Anyone who knows of a script or plugin that lets you set custom keyboard shortcuts for switching between different C4D layouts? I've tried to create my own scripts using commands from the 'Script Log', but it doesn't work (for me). And it's not possible to set the custom shortcuts for Layouts using the 'Customize Command' window either.

Would be nice to have the option to switch between, for example, my 'UV-layout' and 'Modeling layout' just using two quick keys instead of using the menus.
 
Old 04 April 2017   #2
You can load a layout just like a file, the switch will happen automatically:

Code:
import c4d def main(): if c4d.documents.LoadFile("D:/3D/Cinema4D/Cinema4D V18/library/layout/Sculpt.l4d") : print "Load OK" else : print "Load failed" if __name__=='__main__': main()


Note the direction of the slashes (here for Windows).
 
Old 04 April 2017   #3
Quote:
Originally Posted by Cairyn
You can load a layout just like a file, the switch will happen automatically:

Code:
import c4d def main(): if c4d.documents.LoadFile("D:/3D/Cinema4D/Cinema4D V18/library/layout/Sculpt.l4d") : print "Load OK" else : print "Load failed" if __name__=='__main__': main()


Note the direction of the slashes (here for Windows).


Just to chime-in. Is there a way that when you switch lay-out the shortcut keys are also switched. The reason is that I am almost always using Q,W,E,A,S,D,Z,X,C keys.
 
Old 04 April 2017   #4
Quote:
Originally Posted by bentraje
Just to chime-in. Is there a way that when you switch lay-out the shortcut keys are also switched. The reason is that I am almost always using Q,W,E,A,S,D,Z,X,C keys.


You could try this function (no code, copied from Python help):

Code:
c4d.gui.LoadShortcutSet(fn, add) Load shortcuts from fn. Parameters: fn (str or MemoryFileStruct) File with shortcuts to load. add (bool) Add the shortcuts, instead of replacing. Return type: bool Returns: True if successful, otherwise False.


I never tried it though, I use multi-key shortcuts.
 
Old 04 April 2017   #5
very helpful, thanks!
 
Old 04 April 2017   #6
Thanks Cairyn! Not sure if I follow, but should this code be pasted into the 'Python Editor' in the Script Manager? And then I need to create one "Load Layout"-script for each layout and set custom shortcuts to them? I'll try, hope it works! Thanks!
 
Old 04 April 2017   #7
Quote:
Originally Posted by tennet
Thanks Cairyn! Not sure if I follow, but should this code be pasted into the 'Python Editor' in the Script Manager? And then I need to create one "Load Layout"-script for each layout and set custom shortcuts to them? I'll try, hope it works! Thanks!


Yes. You just need to add the LoadShortcutSet command to the first script. You can drop the result check if you don't need to know... your layout/shortcut files are constant I guess.
 
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 05:33 PM.


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