Main Index : Reference :

Basic Functions


Constants

Constant Explanation
NOTOK -1 (defines an invalid state)
TRUE True
FALSE False

Functions

[bool] StopAllThreads();

[bool] DrawViews([int] flags);

[bool] ShowBitmap([BaseBitmap,Filename] s);

[int] GetC4DVersion();
[int] GetCPUCount();

[SysTime] GeGetSysTime();
[int] GeGetCurrentOS();
[string] GeGetLineEnd();
[int] GeGetByteOrder();

[string] SysGetUserInfo([int] x);

[Filename] GeGetStartupPath();
[Filename] GeGetRootFilename();

[bool] GeExeuteProgram([Filename] program, [Filename] file);
[bool] GeExecuteFile([Filename] file);

[bool] LoadDocument([Filename] file);

[int] GeGetMovieFrameCount([Filename] fname);
[int] GeGetMovieFrameRate([Filename] fname);

[bool] SetMousePointer([int] cursor);

[bool] StatusClear();
[bool] StatusSetSpin();
[bool] StatusSetBar([float] percent);
[bool] StatusSetText([string] text);

[BaseContainer] GetWorldContainer();
[bool] SetWorldContainer([BaseContainer] world);

// Command access 
[bool] CallCommand([int] cmdid);
[string] GetCommandName([int] cmdid);
[bool] IsCommandEnabled([int] cmdid);
[bool] IsCommandChecked([int] cmdid); New!

// Event functions 
[bool] EventAdd([[int] flags]);
[bool] SpecialEventAdd([int] messageid, [int] p1, [int] p2);

Descriptions

StopAllThreads()

[bool] StopAllThreads();

Stops editor redraw and editor raytracer immediately. Very important when accessing or modifying global data (like objects) from within an async dialog. Returns TRUE if successful.


DrawViews( flags )

[bool] DrawViews([int] flags);

Forces a manual immediate redraw. Can be used instead of sending a REDRAW_ALL message if the redraw is needed immediately. Returns TRUE if successful. The following flags are available:

Flag Explanation
DA_NO_THREAD Disable threaded redraw
DA_NO_REDUCTION Disable the auto-reduction
DA_ONLY_ACTIVE Only active plane (if available)
DA_ONLY_BACK Only back plane (if available)
DA_ONEPLANE Force a one-plane redraw, saving time.
Has not effect when OpenGL is used.
DA_NO_ANIMATION Calculate no animation effects
DA_NOT_KEY Only calculate non-keyframed animation effects
DA_ONLY_ACTIVE_VIEW Only the active view (if set in preferences)

Attention: If one doesn't use DA_NO_THREAD, one has to call StopAllThreads() before accessing or modifying the document after a redraw. Otherwise very strange crashes can occur, as two threads are accessing the same document.


ShowBitmap()

[bool] ShowBitmap([BaseBitmap,Filename] s);

Displays a bitmap in the Picture Viewer. Returns TRUE if successful.


GetC4DVersion()

[int] GetC4DVersion();

Returns the C4D version number as an integer. For example 6.007 = 6007.

GetCPUCount()

[int] GetCPUCount();

Returns the number of CPU's installed in the computer.


GeGetSysTime()

[SysTime] GeGetSysTime();

Returns the current time and date. See SysTime for more information.

GeGetCurrentOS()

[int] GeGetCurrentOS();

Returns the current OS. The possible return values are:

Value Explanation
GE_WIN Windows
GE_MAC MacOS

GeGetLineEnd()

[string] GeGetLineEnd();

Returns a string with a system dependent string containing "LF", "CR" or a combination of both.

GeGetByteOrder()

[int] GeGetByteOrder();

Returns the byte order of the current OS. The possible return values are:

Value Platform Byte ordering
GE_MOTOROLA Motorola big endian
GE_INTEL Intel little endian


SysGetUserInfo( x )

[string] SysGetUserInfo([int] x);

Returns a string from the user's registration info depending on the value of x:

Value Return string
0 Serial number (11 first digits only!)
1 Name
2 Company
3 Street
4 City
5 Country


GeGetStartupPath()

[Filename] GeGetStartupPath();

Starts a program with file as parameter e.g. Photoshop with a save TIF file.

GeGetRootFilename()

[Filename] GeGetRootFilename();

Returns the path to the current plugin on the harddrive. Very useful for loading resources or bitmaps without the need to use absolute filenames.


GeExeuteProgram( program, file )

[bool] GeExeuteProgram([Filename] program, [Filename] file);

Lets the system open the file with the specified program. Returns TRUE if successful.

GeExecuteFile( file )

[bool] GeExecuteFile([Filename] file);

Lets the system open the file with itīs default application. Returns TRUE if successful.


LoadDocument( file )

[bool] LoadDocument([Filename] file);

Loads file into C4D. The effect is the same as if the user opened the file with Open. If it's a document it is added to the list of open documents, if it's a layout file it is loaded as the current layout etc. Returns TRUE if successful.


GeGetMovieFrameCount( fname )

[int] GeGetMovieFrameCount([Filename] fname);

Returns the number of frames in the movie that fname points to.

GeGetMovieFrameRate()

[int] GeGetMovieFrameRate([Filename] fname);

Returns the frame rate of the movie that fname points to.


SetMousePointer( cursor )

[bool] SetMousePointer([int] cursor);

Sets the mouse pointer to the cursor specified. Returns TRUE if successful. Possible values for cursor are:

Cursor Explanation
MOUSE_HIDE Hides the cursor.
MOUSE_SHOW Shows the cursor.
 
MOUSE_NORMAL Normal cursor
MOUSE_BUSY Busy cursor
 
MOUSE_CROSS Cross-hair cursor
MOUSE_QUESTION Question mark cursor
 
MOUSE_ZOOM_IN Zoom in cursor
MOUSE_ZOOM_OUT Zoom out cursor
 
MOUSE_FORBIDDEN Forbidden cursor (prohibitory sign)
MOUSE_DELETE Delete cursor (trash)
 
MOUSE_COPY Copy cursor (+)
MOUSE_INSERTCOPY Copy insert cursor (arrow and +)
MOUSE_INSERTCOPYDOWN Copy insert under cursor (down arror and +)
 
MOUSE_MOVE Move cursor (square)
MOUSE_INSERTMOVE Move insert cursor (arrow and square)
MOUSE_INSERTMOVEDOWN Move insert under cursor (down arrow and square)
 
MOUSE_ARROW_H Horizontal arrows cursor
MOUSE_ARROW_V Vertical arrows cursor
MOUSE_ARROW_HV Horizontal and vertical arrows cursor
 
MOUSE_POINT_HAND Pointint hand cursor
MOUSE_MOVE_HAND Hand cursor
MOUSE_IBEAM I-beam cursor


StatusClear()

[bool] StatusClear();

Clears the status bar. Returns TRUE if successful.

StatusSetSpin()

[bool] StatusSetSpin();

Shows a spinbar in the status bar. Every time this function is called, the bar will spin a little bit. There's a built-in speed limitation, so it doesn't matter if one calls the function too often. Use this kind of bar when the length of an action is unknown. Returns TRUE if successful.

StatusSetBar( percent )

[bool] StatusSetBar([float] percent);

Shows a progress bar in the statur bar. The progress bar is controlled by the percent parameter (0.0<=percent<=1.0). Returns TRUE if successful.

StatusSetText( text )

[bool] StatusSetText([string] text);

Shows the string text in the status bar. Returns TRUE if successful.


GetWorldContainer()

[BaseContainer] GetWorldContainer();

Returns a container with the global program settings. Valid ids are:

Container ID Type Explanation
 
WPREF_HPB_SYSTEM [bool] Use HPB rotation
WPREF_CENTER [bool] Center new objects in view
WPREF_BACKUP [bool] Generate backup copies
WPREF_RENDERMATS [bool] Render materials on loading
WPREF_TABLETT [bool] Graphic tablett
WPREF_SCALE_AXES [bool] Scale axes
WPREF_SEMI_TRANSPARENCY [bool] Semi-transparent axes
WPREF_OPENGL [bool] Use OpenGL
WPREF_LINK_SELECTION [bool] Link manager selection
WPREF_ONLY_ACTIVEVIEW [bool] Refresh active view only
WPREF_LOAD_MANAGER [bool] Load manager settings
WPREF_SAVE_OPENGL [bool] Save RTTM textures
WPREF_SAVE_PARTICLES [bool] Save particles
WPREF_SAVE_LAYOUT [bool] Save layout at program end
WPREF_RENDER_SAFE [bool] Display render safe
WPREF_ACTION_SAFE [bool] Display action safe
WPREF_TITLE_SAFE [bool] Display title safe
 
WPREF_MAX_UNDOS [int] Undo depth
WPREF_MAX_LAST [int] Recent file list length
 
WPREF_ACTION_FAC [float] Action safe percentage
WPREF_TITLE_FAC [float] Title safe percentage
WPREF_SEMI_FAC [float] Semi-transparent axes percentage
 
WPREF_OPENGL_AA_LINES [bool] Antialiased lines
WPREF_OPENGL_PERSPECT [bool] Perspective correction
WPREF_OPENGL_MIPMAP [bool] MIP maps
WPREF_USE_TEXTURES [bool] Use textures
WPREF_OPENGL_FASTREDRAW [bool] Smart window refresh
WPREF_OPENGL_FASTLIVESELECTION [bool] Smart live selection
 
WPREF_USE_QUICKTIME [bool] Use quicktime
 
WPREF_UNITS_BASIC [int] Basic units (see dialog)
WPREF_UNITS_TIME [int] Animation units (see dialog)
WPREF_UNITS_COLOR [int] Color system (see dialog)
WPREF_UNITS_USEUNITS [bool] Display units
WPREF_REFRESHTIME [int] Redraw limit (ms)
WPREF_RATIO_X [float] Pixel ratio x
WPREF_RATIO_Y [float] Pixel ratio y
 
WPREF_BACKGROUND_COL [vector] Background color
WPREF_FILMFORMAT_COL [vector] Film format color
WPREF_HORIZON_COL [vector] Horizon color
WPREF_GRID_MAJOR_COL [vector] Grid major color
WPREF_GRID_MINOR_COL [vector] Grid minor color
WPREF_SPLINESTART_COL [vector] Spline start color
WPREF_SPLINEEND_COL [vector] Spline end color
WPREF_CAMERA_COL [vector] Camera color
WPREF_PARTICLE_COL [vector] Particle emitter color
WPREF_PMODIFIER_COL [vector] Particle modifier color
WPREF_BONE_COL [vector] Bone color
WPREF_MODIFIER_COL [vector] Deformer color
WPREF_ACTIVEPOINT_COL [vector] Active point color
WPREF_INACTIVEPOINT_COL [vector] Inactive point color
WPREF_TANGENT_COL [vector] Tangent color
WPREF_ACTIVEPOLYGON_COL [vector] Active polygon color
WPREF_INACTIVEPOLYGON_COL [vector] Inactive polygon color
WPREF_TEXTURE_COL [vector] Texture color
WPREF_TEXTUREAXIS_COL [vector] Texture axis color
WPREF_ACTIVEBOX_COL [vector] Activation box color
WPREF_ANIMPATH_COL [vector] Animation path color
WPREF_XAXIS_COL [vector] X-axis color
WPREF_YAXIS_COL [vector] Y-axis color
WPREF_ZAXIS_COL [vector] Z-axis color
WPREF_WXAXIS_COL [vector] World x-axis color
WPREF_WYAXIS_COL [vector] World y-axis color
WPREF_WZAXIS_COL [vector] World z-axis color
WPREF_SELECT_AXIS_COL [vector] Selected axis color
WPREF_LAYER0_COL [vector] Layer 1 color
WPREF_LAYER1_COL [vector] Layer 2 color
WPREF_LAYER2_COL [vector] Layer 3 color
WPREF_LAYER3_COL [vector] Layer 4 color
WPREF_LAYER4_COL [vector] Layer 5 color
WPREF_LAYER5_COL [vector] Layer 6 color
WPREF_LAYER6_COL [vector] Layer 7 color
WPREF_LAYER7_COL [vector] Layer 8 color
WPREF_VERTEXSTART_COL [vector] Vertex map 0%
WPREF_VERTEXEND_COL [vector] Vertex map 100%
 
WPREF_UVMESH_GREYED_COL [vector] Inactive grid
WPREF_UVMESH_ACTIVEAPOLY_COL [vector] Selected polygon
WPREF_UVMESH_INACTIVEAPOLY_COL [vector] Deselected polygon
WPREF_UVMESH_ACTIVEPOINT_COL [vector] Selected polygon
WPREF_UVMESH_INACTIVEAPOINT_COL [vector] Deselected polygon
 
WPREF_BUBBLEHELP1 [bool] Bubble help
WPREF_BUBBLEHELP2 [bool] Help for status bar
WPREF_THREADPRIORITY [bool] High thread priority
 
WPREF_MENUICON [bool] Show icons in menus
WPREF_MENUSHORTCUT [bool] Show shortcuts in menus
 
WPREF_DIALOGSTYLE [int] Dialog style:
  DLG_PC Windows
  DLG_MAC MacOS
 
WPREF_DIALOGALIGN [int] Alignment of dialog groups:
  DLG_ALIGN_LEFT Left
  DLG_ALIGN_CENTER Center
  DLG_ALIGN_RIGHT Right
 
WPREF_DELAY_MENU [int] Menu popup delay (ms)
WPREF_DELAY_MENUSCROLL [int] Menu scrolling delay (ms)
WPREF_DELAY_CMDPOPUP [int] Command popup delay (ms)
WPREF_DELAY_DRAGSCROLL [int] Drag&drop autoscrolling delay (ms)
WPREF_DELAY_SCROLLER1 [int] Scroller arrows delay (ms)
WPREF_DELAY_SCROLLER2 [int] Scroller repeat delay (ms)
WPREF_DELAY_TABSWITCH [int] Tab switch delay (ms)
 
WPREF_COLOR_EDGEWH [vector] White edges color
WPREF_COLOR_EDGELT [vector] Light edges color
WPREF_COLOR_EDGEDK [vector] Dark edges color
WPREF_COLOR_EDGEBL [vector] Black edges color
WPREF_COLOR_TIMESLIDER [vector] Timeslider color
WPREF_COLOR_BG [vector] Background color
WPREF_COLOR_BGEDIT [vector] Editfields background
WPREF_COLOR_BGGADGET [vector] Gadget background
WPREF_COLOR_BGFOCUS [vector] Focus element background color
WPREF_COLOR_TEXT [vector] Text color
WPREF_COLOR_TEXTFOCUS [vector] Focus text color
WPREF_COLOR_DBARFG1 [vector] Inactive dialogbar foreground color
WPREF_COLOR_DBARBG1 [vector] Inactive dialogbar background color
WPREF_COLOR_DBARFG2 [vector] Active dialogbar foreground color
WPREF_COLOR_DBARBG2 [vector] Active dialogbar background color
WPREF_COLOR_BGSELTEXT [vector] Background color of selected text
WPREF_COLOR_FGSELTEXT [vector] Foreground color of selected text
 
WPREF_PATTERN_TIMESLIDER [string] Name of the timeslider pattern bitmap
WPREF_PATTERN_BG [string] Name of the general background pattern bitmap
WPREF_PATTERN_BGEDIT [string] Name of the editfield background pattern bitmap
WPREF_PATTERN_BGGADGET [string] Name of the gadget background pattern bitmap
WPREF_PATTERN_BGFOCUS [string] Name of the focus background pattern bitmap
WPREF_PATTERN_DBARBG1 [string] Name of the inactive dialog bar background pattern bitmap
WPREF_PATTERN_DBARBG2 [string] Name of the active dialog bar background pattern bitmap
 
WPREF_PATTERN_USE [bool] Use patterns
WPREF_NAVSERVICE [bool] Use navigation services (MacOS only)
 

SetWorldContainer( world )

[bool] SetWorldContainer([BaseContainer] world);

Sets the global program settings. For a list of valid ids, please see GetWorldContainer().


CallCommand( cmdid )

[bool] CallCommand([int] cmdid);

Calls the GUI command with ID cmdid. Returns TRUE if the command succeeds.

Note: The GUI command IDs can be looked up in the Command manager. E.g. if you click on "MAXON Homepage..." the command manager shows ID 13681. So CallCommand(13681) executes this command.

GetCommandName( cmdid )

[bool] GetCommandName([int] cmdid);

Returns the name of the GUI command with ID cmdid.

IsCommandEnabled( cmdid )

[bool] IsCommandEnabled([int] cmdid);

Returns TRUE if the command with ID cmdid is enabled.

IsCommandChecked( cmdid )

[bool] IsCommandChecked([int] cmdid);

Returns TRUE if the command with ID cmdid is checked.