c4d.storage
¶
Follow me to the Inheritance diagramm .
GeGetC4DPath()
GeGetPluginPath()
GeGetStartupApplication()
GeGetStartupWritePath()
GeGetStartupPath()
GetUserSiteSpecificPath()
GetFreeVolumeSpace()
c4d.storage.
LoadDialog
(
[type=FILESELECTTYPE_ANYTHING][, title=”“][, flags=FILESELECT_LOAD][, force_suffix=”“][, def_path=”“][, def_file=”“]
)
¶
Open a load dialog. The look of this dialog depends on the operating system.
Warning
If the filename returned by
LoadDialog()
will be passed to a non-Cinema 4D function it must be decoded to an utf-8 object:
fn = LoadDialog() f = open(fn.decode("utf-8")) # open() is a non-Cinema 4D function so it needs a decode but it works with a Cinema 4D function: doc = LoadDocument(fn) # or doc = LoadDocument(fn.decode("utf8"))
Parameters: |
|
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
str |
||||||||||||||||
Returns: |
The selected path. |
c4d.storage.
SaveDialog
(
[type=FILESELECTTYPE_ANYTHING][title=”“][, force_suffix=”“][, def_path][, def_file=”“]
)
¶
Open a save dialog. The look of this dialog depends on the operating system.
Parameters: |
|
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
str |
||||||||||
Returns: |
The selected path. |
c4d.storage.
ShowInFinder
(
path
,
open
)
¶
Show the file/path in the Finder (OSX) or Explorer (Windows).
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the path/file exists, otherwise False . |
c4d.storage.
GeGetPluginPath
(
)
¶
Warning
The Python implementation is different from the C++ in the fact that, with the Python SDK, this function returns the path of the Python SDK module. To get the path of your Python plugin use __file__ .
See also
Return type: | str |
---|---|
Returns: | The path of the Python SDK module. |
c4d.storage.
GeGetC4DPath
(
whichpath
)
¶
Gets one of the Cinema 4D paths.
Parameters: |
whichpath
(
int
) –
The path to get:
|
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | str | ||||||||||||||||||
Returns: | The retrieved path. |
c4d.storage.
GeGetStartupApplication
(
)
¶
Returns the complete path of the host application (Cinema 4D, BODYPAINT 3D, NET) of the plugin:
(Mac) e.g: '/Applications/MAXON/Cinema 4D R12/Cinema 4D.app'
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:
(Mac) e.g: '/Users/UserName/Library/Preferences/MAXON/Cinema 4D R12_C333CB6C'
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.
GeGetMemoryStat
(
)
¶
Gets Cinema 4D memory statistics.
Return type: | c4d.BaseContainer | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: |
Can be
None
if receiving memory container failed. Assigned statistics:
|
c4d.storage.
GeMemGetFreePhysicalMemoryEstimate
(
)
¶
Get the estimated free physical memory.
Return type: | long |
---|---|
Returns: | The estiumated free physical memory. |
c4d.storage.
WriteHyperFile
(
doc
,
node
,
filename
,
ident
)
¶
Writes a single list node to disk as a hyper file.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
int |
||||||||||||||||||||||||||||
Returns: |
The result:
|
c4d.storage.
ReadHyperFile
(
doc
,
node
,
filename
,
ident
)
¶
Reads a single list node from a hyper file on disk. The read data replaces the data in node .
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
int |
||||||||||||||||||||||||||||
Returns: |
The result:
|
c4d.storage.
GeGetStartupPath
(
)
¶
Get the path for the main folder Cinema 4D:
(Mac) e.g: '/Applications/MAXON/Cinema 4D R12'
Return type: | str |
---|---|
Returns: | The main path for the Cinema 4D application. |
c4d.storage.
GetUserSiteSpecificPath
(
)
¶
New in version R15.037.
Get the path to the site folder in the user folder.
(Windows 64-bits) e.g: ‘C:/Users/$UserName/AppData/Roaming/MAXON/R15/library/python/packages/win64’
Note
This folder exists so that 3rd party packages can be installed in it.
Return type: | str |
---|---|
Returns: | The path to the site folder in the user folder. |
c4d.storage.
GetFreeVolumeSpace
(
drive
)
¶
New in version R16.021.
Calculate the free space on a volume.
Parameters: | drive ( str ) – Can point to a volume or directory. |
---|---|
Return type: | tuple(long, long) |
Returns: | The number of available bytes on the volume and the total size of the volume in bytes. |
c4d.storage.
GeExecuteProgram
(
app
,
path
)
¶
Executes an application.
Note
The application is started asynchronously.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the application was executed, otherwise False . |
c4d.storage.
GeExecuteFile
(
path
)
¶
Executes a file.
Note
Opens a file as if the user double-clicked it: the default application for this file will open.
Parameters: | path ( str ) – The name of the application to execute. |
---|---|
Return type: | bool |
Returns: | True if the application was executed, otherwise False . |
c4d.storage.
GeGetMovieInfo
(
path
)
¶
Get information from a movie file.
Parameters: |
path
(str or
MemoryFileStruct
) – The path of the movie file.
|
---|---|
Return type: | dict{ frames : int, fps : float} |
Returns: | The number of frames and frames per second. |
c4d.storage.
GeIdentifyFile
(
name
,
probe
,
recognition
)
¶
Identify the file in name.
Parameters: |
|
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
tuple(int,
|
||||||||||||||||||
Returns: |
The result and, for image formats, the image loader that was identified.
|