Layout switch

On 17/01/2013 at 02:27, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   13 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
Hello,

I like to know how I can switch the layout with the CallCommand(56000).
My intention is to switch maybe from start layout to animation layout or an own layout definition per plugin.

Thanks
Marky

On 17/01/2013 at 03:04, xxxxxxxx wrote:

Hi.
I use python script for this:

import c4d, os  
from c4d import gui, documents  
#Welcome to the world of Python  
  
  
def main() :  
  c4d.documents.LoadFile(c4d.storage.GeGetC4DPath(c4d.C4D_PATH_LIBRARY_USER)+os.sep+"layout"+os.sep+"layoutname.l4d")  
  
if __name__=='__main__':  
  main()

Cheers
Phil

On 21/01/2013 at 00:47, xxxxxxxx wrote:

Oh thanks, it's working.

One question, it's possible to start an python script automatically if Cinema4d started?

Marky

On 21/01/2013 at 01:03, xxxxxxxx wrote:

Originally posted by xxxxxxxx

One question, it's possible to start an python script automatically if Cinema4d started?

Hi Marky,

I think you could use -layout command line argument. 
This command lets you load a specific layout when starting CINEMA 4D.

On 21/01/2013 at 04:11, xxxxxxxx wrote:

Afaik, there is (or can be) a startup.py in the user preferences folder, is that correct?

On 21/01/2013 at 07:40, xxxxxxxx wrote:

Originally posted by xxxxxxxx

Afaik, there is (or can be) a startup.py in the user preferences folder, is that correct?

A special script python_init.py can be defined in  {USER_FOLDER}/prefs/python to execute some Python code on startup of CINEMA 4D before any other Python stuff is loaded.
This information is included in the Frequently Asked Questions of the docs.

On 28/05/2014 at 10:13, xxxxxxxx wrote:

Is there no way to have all C4D applications source from one common python script folder for the facility?  Most production houses have common code development areas, can we not change the python source directory to a central server location?