c4d.storage – a module for file operations

To get an overview of the class members, check out the diagram.

Class

Functions

c4d.storage.LoadDialog([type=FSTYPE_ANYTHING][, title][, flags=0][, def_path])

Open a load dialog. The look of this dialog depends on the operating system.

../../_images/open_dialog.png
Parameters:
  • type (int) –

    One of the following flags:

    FSTYPE_ANYTHING Any file.
    FSTYPE_IMAGES Image files.
    FSTYPE_SCENES 3D files.
    FSTYPE_COFFEE C.O.F.F.E.E. files.
  • flags (int) –

    A flag:

    GE_DIRECTORY Open directory dialog.
  • def_path (str) – Set the path which is shown on popup.
Return type:

str or None

Returns:

The path or None if the user aborted.

c4d.storage.SaveDialog([type=FSTYPE_ANYTHING][, title=][, flags=0][, def_path])

Open a save dialog. The look of this dialog depends on the operating system.

../../_images/save_dialog.png
Parameters:
  • type (int) –

    One of the following flags:

    FSTYPE_ANYTHING Any file.
    FSTYPE_IMAGES Image files.
    FSTYPE_SCENES 3D files.
    FSTYPE_COFFEE C.O.F.F.E.E. files.
  • title (str) – The title.
  • flags (bool) – Use True for a directory dialog. File dialog is default.
  • def_path (str) – Set the path which is shown on popup.
Return type:

str or None

Returns:

The path or None if the user aborted.

c4d.storage.ShowInFinder(path)

Show the file/path in the Finder (OSX) or Explorer (Windows).

Parameter:path (str) – The file/path to show.
Return type:bool
Returns:True if the path/file exists, otherwise False.
c4d.storage.GeGetPythonPath()

Returns the path to the Py4D plugin.

Return type:str
Returns:The complete path to Py4D.
c4d.storage.GeGetC4DPath(whichpath)

Gets one of the CINEMA 4D paths.

Parameter:whichpath (int) –

The path to get:

C4D_PATH_PREFS CINEMA 4D prefs directory
C4D_PATH_RESOURCE CINEMA 4D resource directory
C4D_PATH_LIBRARY CINEMA 4D library directory (builtin)
C4D_PATH_LIBRARY_USER CINEMA 4D library directory (different if multiuser mode enabled).
C4D_PATH_ONLINE_HELP CINEMA 4D Online Help Directory.
C4D_PATH_DESKTOP OS Desktop Directory
C4D_PATH_HOME OS Home Directory
C4D_PATH_STARTUPWRITE Writeable StartupDir.
C4D_PATH_MYDOCUMENTS The user’s documents directory.
Return type:str
Returns:The complete path to Py4D.
c4d.storage.GeGetStartupApplication()

Returns the complete path of the host application (CINEMA 4D, BODYPAINT 3D, NET) of the plugin.

Return type:str
Returns:The complete path to the host application.
c4d.storage.GeGetStartupWritepath()

Returns the writeable startup directory. This is the directory where all user data (preferences, libraries etc.) are stored.

Note

Use this for example to store plugin preferences because Windows Vista and Apple Leopard do not allow to write files into the application folder.

Return type:str
Returns:The writeable startup directory.
c4d.storage.GeGetStartupPath()

Get the path for the main folder CINEMA.

Return type:str
Returns:The main path for the CINEMA application.
c4d.storage.GeExecuteProgram(app, path)

Execute an application.

Note

The application will be started asynchronous.

Parameters:
  • app (str) – The name of an optional file to open using the application.
  • path (str) – The name of the application to execute.
Return type:

bool

Returns:

Success of executing the application.

c4d.storage.GeExecuteFile(path)

Execute a file with a defined application.

Parameter:path (str) – The name of the application to execute.
Return type:bool
Returns:Success of executing the application.

Table Of Contents

This Page