3DCoat Python API
The 3DCoat Python API documentation.
|
Static Public Member Functions | |
str | installPath () |
the 3DCoat installation path | |
str | dataPath () |
the 3DCoat data path | |
str | documents (str path) |
convert the relative path to the path in documents, if the path is absolute, just return the original path | |
bool | fileExists (str path) |
check if file exists | |
copyFile (str src, str dest) | |
copy the file from src to dest. | |
copyFolder (str src, str dest) | |
copy the whole folder from src to dest. | |
removeFile (str filename) | |
remove the file. | |
removeFolder (str folder) | |
remove the folder. | |
str | toFullPathInDataFolder (str path) |
convert the relative path to full path in documents folder. | |
toFullPathInDataFolder (any path) | |
str | toFullPathInInstallFolder (str path) |
convert the relative path to the full path in the install folder. | |
toFullPathInInstallFolder (any path) | |
str | convertToWritablePath (str path) |
If the path is relative or points into some file in the install folder, it will be converted to the path in documents folder. | |
convertToWritablePath (any path) | |
str | convertToWritablePathIfFileExists (str path) |
If the path is relative or points into some file in the install folder, it will be converted to the path in documents folder. | |
convertToWritablePathIfFileExists (any path) | |
str | getExtension (str filepath) |
get the file extension (without .) | |
str | getFileName (str filepath) |
get the file name from the path | |
str | getFilePath (str filepath) |
get the file path without the filename | |
str | getFileNameWithoutExtension (str filepath) |
remove the file extension from the filename | |
str | strFromFile (str filename) |
read string from file. | |
strToFile (str text, str filename) | |
write the string to file | |
int | getFileSize (str filename) |
get the file size | |
vec2 | cursorPos () |
returns the current cursor position | |
vec2 | snappedCursorPos () |
returns the snapped cursor position | |
rect | wholeScreen () |
get the whole screen rectangle | |
rect | workArea () |
get the work area rectangle | |
progressBar (float stage, float max_stage, str message) | |
Show the progress bar. | |
progressBarInWindowHeader (float stage, float max_stage, str message) | |
Show the progress bar only in the 3DCoat's window header. | |
setWindowTitle (str text, float seconds) | |
Override the 3DCoat's window title for some amount of time. | |
step (int count=1) | |
perform rendering cycles | |
exec (str command, str arguments=None) | |
execute command. | |
str | execAndWait (str command, str arguments=None) |
execute and wait till finished, the console output will be returned as string | |
updateCoatPyi (str folderOrFile) | |
update the .pyi file for the given folder or py file | |
list | ListFiles (str folder, str mask, bool recursive=True) |
list files in the folder | |
list | ListFolders (str startFolder) |
list folders within the folder, non-recursive, just plain list | |
str | supportedImagesFormats () |
returns the currently supported mesh export formats | |
str | supportedMeshesFormats () |
returns the list of supported images formats | |
bool | openFileDialog (str extensions, any fileName) |
show the file dialog | |
str | openFileDialog (str extensions) |
list | openFilesDialog (str extensions) |
open multiple files dialog | |
bool | saveFileDialog (str extensions, any fileName) |
show the save file dialog | |
str | saveFileDialog (str extensions) |
str | currentSceneFilepath () |
returns the current scene filename, empty if the scene was not saved/opened | |
pipInstall (str requirements) | |
install one or multiple python packages | |
pipUninstall (str requirements) | |
str | pythonPath () |
get the python libraries folder | |
showPythonConsole () | |
Show the python console, clear it and pop up. | |
executeScript (str path) | |
execute python (.py file) or angelscript (c++ like), or CoreAPI (native C++) script | |
installRequirements (str path_to_requirements_txt) | |
Install all the requirements for the python script execution. | |
str | toJson (any obj, str filename="") |
Store the object to the file or string as json. | |
fromJsonFile (any obj, str filename) | |
Restore the object from the json file. | |
restoreObjectFormJsonString (any obj, str data) | |
Restore the object from the json string. | |
createRedistributablePackageFromFolder (str folder, str package_name, str excluded_folders_names="", str excluded_extensions="") | |
Create the 3dcpack file from the folder placed in Documents. | |
int | getDownloadProgress () |
returns the overall download progress | |
list | listBlenderInstallFolders () |
list the blender install folders | |
saveScreenshot (str filename, int x=0, int y=0, int width=0, int height=0) | |
save the screenshot to the file | |
removeBackground (str image1, str image2, str result) | |
|
static |
|
static |
If the path is relative or points into some file in the install folder, it will be converted to the path in documents folder.
path | the path (full or relative) |
|
static |
|
static |
If the path is relative or points into some file in the install folder, it will be converted to the path in documents folder.
If the does not exist in the documents folder, but exists in the install folder, the resulting path will be in the install folder.
path | the path (full or relative) |
|
static |
copy the file from src to dest.
If the src or dest is relative, it is relative to the documents folder. This function works correctly with relative paths, so it is recommended over the standard copy files routine.
src | the source filename |
dest | the destination filename |
|
static |
copy the whole folder from src to dest.
If the src or dest is relative, it is relative to the documents folder. This function works correctly with relative paths, so it is recommended over the standard copy folder routine.
src | the source folder |
dest | the destination folder |
|
static |
Create the 3dcpack file from the folder placed in Documents.
folder | the folder to pack, it should be relative to the 3DCoat's Documents folder |
package_name | the package name, the extension is .3dcpack |
excluded_folders_names | the folders names to be excluded from the package, separated by semicolon |
excluded_extensions | the file extensions to be excluded from the package, separated by semicolon |
|
static |
returns the current scene filename, empty if the scene was not saved/opened
|
static |
returns the current cursor position
|
static |
the 3DCoat data path
|
static |
convert the relative path to the path in documents, if the path is absolute, just return the original path
path | the relative or absolute path |
|
static |
execute command.
It may be exe file, URL, batch command
command | the command to execute |
arguments | optional command line arguments |
|
static |
execute and wait till finished, the console output will be returned as string
command | the command to execute |
arguments | optional arguments |
|
static |
execute python (.py file) or angelscript (c++ like), or CoreAPI (native C++) script
path | the full or relative path to the script file |
|
static |
check if file exists
path | the path may be full or relative. If it is relative, the documents will be checked first, the the install folder will be checked for file. |
|
static |
Restore the object from the json file.
obj | the object to restore |
filename | the path to the json file, full or relative |
|
static |
returns the overall download progress
|
static |
get the file extension (without .)
filepath | the file path - full or relative |
|
static |
get the file name from the path
filepath | the full or relative path |
|
static |
remove the file extension from the filename
filepath | the file name |
|
static |
get the file path without the filename
filepath | the filepath |
|
static |
get the file size
filename | the filename, relative or full |
|
static |
the 3DCoat installation path
|
static |
Install all the requirements for the python script execution.
path_to_requirements_txt | te full or relative path to the requirements.txt |
|
static |
list the blender install folders
|
static |
list files in the folder
folder | the start folder. It may be absolute or relative to 3DCoat documents/install folder. |
mask | the seek mask (wildcards) |
recursive | set true if recursive |
|
static |
list folders within the folder, non-recursive, just plain list
startFolder | the start folder |
|
static |
|
static |
show the file dialog
extensions | the list of supported extensions like *.txt;*.dat; etc... |
fileName | the resulting filename |
|
static |
open multiple files dialog
extensions | the list of supported extensions like *.txt;*.dat; etc... |
|
static |
install one or multiple python packages
requirements | the list of packages to install, this is all what you write after "pip install" |
|
static |
|
static |
Show the progress bar.
stage | the current stage |
max_stage | the maximal stage |
message | the text to display |
|
static |
Show the progress bar only in the 3DCoat's window header.
stage | the current stage |
max_stage | the maximal stage |
message | the text to display |
|
static |
get the python libraries folder
|
static |
|
static |
remove the file.
If the filename is relative, it is relative to the documents folder. If the path is in install folder, the corresponding file in documents will be removed. Files in the install folder can't be removed.
filename | the file path |
|
static |
remove the folder.
If the folder is relative, it is relative to the documents folder. If the path is in install folder, the corresponding folder in documents will be removed.
folder | the path to the folder |
|
static |
Restore the object from the json string.
obj | the object to restore |
data | the json string |
|
static |
|
static |
show the save file dialog
extensions | extensions the list of supported extensions like *.txt;*.dat; etc... |
fileName | the resulting filename |
|
static |
save the screenshot to the file
filename | the filename |
x | the x coordinate of the screenshot |
y | the y coordinate of the screenshot |
width | the width of the screenshot, if 0 all to the right will be captured |
height | the height of the screenshot, if 0 all to the bottom will be captured |
|
static |
Override the 3DCoat's window title for some amount of time.
text | the text to show |
seconds | the seconds to stay in title |
|
static |
Show the python console, clear it and pop up.
|
static |
returns the snapped cursor position
|
static |
perform rendering cycles
count | amount of cycles |
|
static |
read string from file.
filename | The path. If it is relative, it is relative to the documents folder. If there is no file, it will be taken from the install folder. |
|
static |
write the string to file
text | the text to save |
filename | The path. If it is relative, it is relative to the documents folder. |
|
static |
returns the currently supported mesh export formats
|
static |
returns the list of supported images formats
|
static |
|
static |
convert the relative path to full path in documents folder.
If the path is full and placed in the install folder, it will be converted to path in documents.
path | the path |
|
static |
|
static |
convert the relative path to the full path in the install folder.
If the path is full, it remains untouched.
path | the relative path |
|
static |
Store the object to the file or string as json.
obj | the python object reference |
filename | the filename to save, if empty, the string will be returned |
|
static |
update the .pyi file for the given folder or py file
folderOrFile | the full or relative path to the folder or py file |
|
static |
get the whole screen rectangle
|
static |
get the work area rectangle