-
首页
-
C4D R23.110 C++ SDK
c4d_general.h File Reference
函数
|
maxon::String
|
GeGetUserName
()
|
VERSIONTYPE
|
GeGetVersionType
(void)
|
maxon::Result
< void >
|
GetGeneralLicensingInformation
(
maxon::String
&productId,
maxon::String
&systemId,
maxon::String
&userId,
maxon::String
&licenseId,
maxon::String
&userName)
|
maxon::Result
<
maxon::String
>
|
ExportLicenses
()
|
maxon::Result
< void >
|
AddLicenseItem
(const
maxon::InternedId
&licenseItemId,
Float
versionNumber,
Bool
checkOnly,
maxon::CustomLicenseItemDelegate
&&licenseUpdateCallback)
|
maxon::Bool
|
CheckLicenseFeature
(const
maxon::InternedId
&featureId)
|
Bool
|
HasFullFeatureSet
()
|
Bool
|
IsNet
()
|
Bool
|
IsServer
()
|
Bool
|
IsClient
()
|
void
|
GeShowMouse
(
Int32
v)
|
Bool
|
GeGetScreenDimensions
(
Int32
x,
Int32
y,
Bool
whole_screen,
Int32
*sx1,
Int32
*sy1,
Int32
*sx2,
Int32
*sy2)
|
Int32
|
GeGetTimer
(void)
|
Float64
|
GeGetMilliSeconds
(void)
|
String
|
GeGetLineEnd
(void)
|
Int32
|
GeGetDefaultFPS
(void)
|
UInt32
|
GeGetCinemaInfo
(
CINEMAINFO
info)
|
GEMB_R
|
GeOutString
(const
maxon::String
&str,
GEMB
flags)
|
OPERATINGSYSTEM
|
GeGetCurrentOS
(void)
|
BYTEORDER
|
GeGetByteOrder
(void)
|
void
|
GeGetGray
(
Int32
*r,
Int32
*g,
Int32
*b)
|
Bool
|
GeChooseColor
(
向量
*col,
Int32
flags)
|
Bool
|
GeChooseColorAlpha
(
maxon::ColorA
*col,
Int32
flags)
|
Bool
|
GeOpenHTML
(const
maxon::String
&webaddress)
|
Bool
|
GeChooseFont
(
BaseContainer
*bc)
|
void
|
GeGetGuiFont
(maxon::OSFontDefinition &out)
|
void
|
GeGetMonoFont
(maxon::OSFontDefinition &out)
|
Bool
|
GeRegisterPlugin
(
PLUGINTYPE
type,
Int32
id, const
maxon::String
&str, void *data,
Int32
datasize)
|
void
|
GePrint
(const
maxon::String
&str)
|
void
|
GeConsoleOut
(const
maxon::String
&str)
|
Bool
|
GeGetMovieInfo
(const
Filename
&fn,
Int32
*frames,
Float
*fps)
|
Bool
|
RenameDialog
(
String
*str)
|
Int32
|
GetC4DVersion
(void)
|
String
|
GeGetDegreeChar
()
|
String
|
GeGetPercentChar
()
|
void
|
SetMousePointer
(
Int32
l)
|
Bool
|
ShowBitmap
(const
Filename
&fn)
|
Bool
|
ShowBitmap
(
BaseBitmap
*bm)
|
void
|
StopAllThreads
(void)
|
void
|
StopDrawViewsThread
()
|
Bool
|
ShutdownThreads
(
Bool
shutdown)
|
void
|
SpecialEventAdd
(
Int32
messageid,
UInt
p1=0,
UInt
p2=0)
|
void
|
EventAdd
(
EVENT
eventflag=
EVENT::NONE
)
|
Bool
|
GeSyncMessage
(
Int32
messageid,
Int32
destid=0,
UInt
p1=0,
UInt
p2=0)
|
Bool
|
DrawViews
(
DRAWFLAGS
flags,
BaseDraw
*bd=nullptr)
|
Bool
|
SendModelingCommand
(
Int32
command,
ModelingCommandData
&data)
|
maxon::Result
<
TexturePathList
>
|
GetGlobalTexturePaths
(const
Filename
*docPath)
|
maxon::Result
< void >
|
SetGlobalTexturePaths
(const
TexturePathList
&paths)
|
Bool
|
GenerateTexturePath
(const
Filename
&docpath, const
Filename
&srcname, const
Filename
&suggestedfolder,
Filename
*dstname,
NetRenderService
*service=nullptr,
BaseThread
*bt=nullptr)
|
Bool
|
IsInSearchPath
(const
Filename
&texfilename, const
Filename
&docpath)
|
void
|
FlushTexture
(const
Filename
&docpath, const
maxon::String
&name, const
Filename
&suggestedfolder)
|
void
|
FlushUnusedTextures
(void)
|
BaseContainer
|
GetWorldContainer
(void)
|
BaseContainer
*
|
GetWorldContainerInstance
(void)
|
void
|
GetAdditionalWorldContainerData
(
BaseContainer
&bc)
|
maxon::Result
<
maxon::BaseArray
<
maxon::Url
> >
|
GetRecentDocumentsList
(
Bool
isBodyPaint)
|
maxon::Id
|
GetActiveNodeSpaceId
()
|
void
|
SaveWorldPreferences
()
|
void
|
SetWorldContainer
(const
BaseContainer
&bc)
|
向量
|
GetViewColor
(
Int32
colid,
向量
*defaultColor=nullptr)
|
void
|
SetViewColor
(
Int32
colid, const
向量
&col)
|
void
|
ErrorStringDialog
(
CHECKVALUERANGE
type,
Float
x,
Float
y,
CHECKVALUEFORMAT
is)
|
Bool
|
ReadPluginInfo
(
Int32
pluginid, void *buffer,
Int32
size)
|
Bool
|
WritePluginInfo
(
Int32
pluginid, void *buffer,
Int32
size)
|
Bool
|
ReadRegInfo
(
Int32
pluginid, void *buffer,
Int32
size)
|
Bool
|
WriteRegInfo
(
Int32
pluginid, void *buffer,
Int32
size)
|
BaseContainer
*
|
GetWorldPluginData
(
Int32
id)
|
Bool
|
SetWorldPluginData
(
Int32
id, const
BaseContainer
&bc,
Bool
add=true)
|
BaseContainer
*
|
GetToolPluginData
(
BaseDocument
*doc,
Int32
id)
|
Bool
|
GeIsActiveToolEnabled
(void)
|
ToolPlugin
*
|
GetActiveTool
()
|
Bool
|
GeGetLanguage
(
Int32
index,
maxon::String
*extension,
maxon::String
*name,
Bool
*default_language)
|
Filename
|
GeFilterSetSuffix
(const
Filename
&name,
Int32
id)
|
IDENTIFYFILE
|
GeIdentifyFile
(const
Filename
&name,
UChar
*probe,
Int32
probesize,
IDENTIFYFILE
recognition,
BasePlugin
**bp)
|
GeListHead
*
|
GetScriptHead
(
Int32
type)
|
Int32
|
GetDynamicScriptID
(
BaseList2D
*bl)
|
Bool
|
GetCommandLineArgs
(
C4DPL_CommandLineArgs
&args)
|
String
|
GetObjectName
(
Int32
type)
|
String
|
GetTagName
(
Int32
type)
|
Int32
|
GetObjectType
(const
maxon::String
&name)
|
Int32
|
GetTagType
(const
maxon::String
&name)
|
Bool
|
GeRegistryAdd
(
Int32
sub_id,
REGISTRYTYPE
main_id, void *data)
|
Bool
|
GeRegistryRemove
(
Int32
sub_id,
REGISTRYTYPE
main_id)
|
Registry
*
|
GeRegistryFind
(
Int32
sub_id,
REGISTRYTYPE
main_id)
|
Registry
*
|
GeRegistryGetLast
(
REGISTRYTYPE
main_id)
|
Registry
*
|
GeRegistryGetFirst
(
REGISTRYTYPE
main_id)
|
Bool
|
GeRegistryGetAutoID
(
Int32
*id)
|
Bool
|
GePluginMessage
(
Int32
id, void *data)
|
Bool
|
CheckIsRunning
(
CHECKISRUNNING
type)
|
String
|
GeGetDefaultFilename
(
Int32
id)
|
void
|
FindInManager
(
BaseList2D
*bl)
|
void
|
GeSleep
(
Int32
milliseconds)
|
Bool
|
GeIsMainThread
()
|
Bool
|
GeIsMainThreadAndNoDrawThread
()
|
void
|
_GeDebugBreak
(
Int32
line, const
Char
*file)
|
void
|
GeDebugOut
(const
Char
*s,...)
|
void
|
GeDebugOut
(const
maxon::String
&s)
|
GeData
|
SendCoreMessage
(
Int32
coreid, const
BaseContainer
&msg,
Int32
eventid=0)
|
String
|
GetMacModel
(const
maxon::String
&machinemodel)
|
enum
MACHINEFEATURESTYPE
|
MAXON_ENUM_LIST
(
MACHINEFEATURESTYPE
)
|
BaseContainer
|
GetMachineFeatures
(
MACHINEFEATURESTYPE
type=
MACHINEFEATURESTYPE::HARDWARE_OGL
)
|
Bool
|
GeGetMemoryStat
(
BaseContainer
&stat)
|
Bool
|
PopupEditText
(
Int32
screenx,
Int32
screeny,
Int32
width,
Int32
height, const
maxon::String
&changeme,
maxon::Delegate
< void(
POPUPEDITTEXTCALLBACK
,
maxon::String
&)> func)
|
void
|
StartEditorRender
(
Bool
active_only,
Bool
raybrush,
Int32
x1,
Int32
y1,
Int32
x2,
Int32
y2,
BaseThread
*bt,
BaseDraw
*bd,
Bool
newthread)
|
String
|
FormatNumber
(const
GeData
&val,
Int32
format,
Int32
fps,
Bool
bUnit=true)
|
GeData
|
StringToNumber
(const
maxon::String
&text,
Int32
format,
Int32
fps, const
LENGTHUNIT
*lengthunit=nullptr)
|
void
|
CallCommand
(
Int32
id,
Int32
subid=0)
|
String
|
GetCommandName
(
Int32
id)
|
String
|
GetCommandHelp
(
Int32
id)
|
Bool
|
IsCommandEnabled
(
Int32
id)
|
Bool
|
IsCommandChecked
(
Int32
id)
|
Bool
|
GetSystemEnvironmentVariable
(const
maxon::String
&varname,
maxon::String
&result)
|
Bool
|
AskForAdministratorPrivileges
(const
maxon::String
&msg, const
maxon::String
&caption,
Bool
allowsuperuser, void **token)
|
void
|
EndAdministratorPrivileges
()
|
void
|
RestartApplication
(const
Utf16Char
*param=nullptr,
Int32
exitcode=0, const
Utf16Char
**path=nullptr)
|
void
|
SetExitCode
(
Int32
exitCode)
|
void
|
GeUpdateUI
()
|
VIEWPORTTYPE
|
GeGetActiveViewportType
()
|
Int32
|
GetShortcutCount
()
|
BaseContainer
|
GetShortcut
(
Int32
index)
|
Bool
|
AddShortcut
(const
BaseContainer
&bc)
|
Bool
|
RemoveShortcut
(
Int32
index)
|
Bool
|
LoadShortcutSet
(const
Filename
&fn,
Bool
add)
|
Bool
|
SaveShortcutSet
(const
Filename
&fn)
|
Int32
|
FindShortcutsFromID
(
Int32
pluginid,
Int32
*indexarray,
Int32
maxarrayelements)
|
Int32
|
FindShortcuts
(const
BaseContainer
&scut,
Int32
*idarray,
Int32
maxarrayelements)
|
Bool
|
CheckCommandShortcut
(
Int32
id,
Int32
key,
Int32
qual)
|
void
|
InsertCreateObject
(
BaseDocument
*doc,
BaseObject
*op,
BaseObject
*activeobj=nullptr)
|
void
|
CopyToClipboard
(const
maxon::String
&text)
|
void
|
CopyToClipboard
(
BaseBitmap
*map,
Int32
ownerid)
|
Bool
|
GetStringFromClipboard
(
String
*txt)
|
Bool
|
GetBitmapFromClipboard
(
BaseBitmap
*map)
|
CLIPBOARDTYPE
|
GetClipboardType
(void)
|
Int32
|
GetC4DClipboardOwner
(void)
|
void
|
BrowserLibraryPopup
(
Int32
mx,
Int32
my,
Int32
defw,
Int32
defh,
Int32
pluginwindowid,
Int32
presettypeid, void *userdata,
BrowserPopupCallback
callback)
|
const
BaseBitmap
*
|
GetCursorBitmap
(
Int32
type,
Int32
&hotspotx,
Int32
&hotspoty)
|
Bool
|
CodeEditor_Open
(
BaseList2D
*obj, const
maxon::Delegate
<
GeData
(
BaseList2D
*obj, const
BaseContainer
&msg)> &callback, const
BaseContainer
&bc=
BaseContainer
())
|
void
|
MinimalViewportSettingsCommand
(
Int32
type)
|
Bool
|
IsAnimationRunning
(const
BaseDocument
*document)
|
Bool
|
IsUVToolMode
(const
BaseDocument
*document)
|
Typedef Documentation
◆
TexturePathTuple
◆
TexturePathList
Function Documentation
◆
GeGetUserName()
Returns the name of the user registered in the active account.
-
返回
-
The user name.
◆
GeGetVersionType()
Retrieves the type of
Cinema 4D
application that is running.
-
返回
-
The version type:
VERSIONTYPE
◆
GetGeneralLicensingInformation()
Returns information about the currently used license and system.
-
参数
-
[out]
|
productId
|
The product id of the active license.
|
[out]
|
systemId
|
A unique system identifier.
|
[out]
|
userId
|
The user id that the active license is assigned with.
|
[out]
|
licenseId
|
A unique license session identifier.
|
[out]
|
userName
|
The user / account name that the active license is assigned with.
|
-
返回
-
OK on success.
◆
ExportLicenses()
Returns licensing information as shown in the ExportLicenses menu command including productId, systemId, userId etc.
-
返回
-
OK on success.
◆
AddLicenseItem()
Private
. AddLicenseItem adds extra licenses to query for each license check. This allows to verify extra features bundled with the app.
-
参数
-
[in]
|
licenseItemId
|
Id to check.
|
[in]
|
versionNumber
|
Current version number of the feature. '0' if no version number is required.
|
[in]
|
checkOnly
|
True if the license should only checked for availability. In that case the license will not be consumed and displayed only in error case.
|
[in]
|
licenseUpdateCallback
|
Callback which will be triggered with each license update for this type.
|
-
返回
-
OK on success.
◆
CheckLicenseFeature()
CheckLicenseFeature queries certain license features. This includes predefined is as well as license items added with
AddLicenseItem()
.
-
参数
-
[in]
|
featureId
|
Id to check. e.g. ENTITLEMENTFEATURES::ISBETA
|
-
返回
-
OK on success.
◆
HasFullFeatureSet()
Bool
HasFullFeatureSet
|
(
|
|
)
|
|
Determines whether the type of
Cinema 4D
application has no feature limitations. Certain editions like C4D Lite do not allow for all features.
-
返回
-
true
if If all features are available., otherwise
false
.
◆
IsNet()
Checks if either a NET server or client application is running.
-
返回
-
true
if NET is running, otherwise
false
.
◆
IsServer()
Checks if a NET server application is running.
-
返回
-
true
if NET is running as server, otherwise
false
.
◆
IsClient()
Checks if a NET client application is running.
-
返回
-
true
if NET is running as client, otherwise
false
.
◆
GeShowMouse()
void GeShowMouse
|
(
|
Int32
|
v
|
)
|
|
Sets the type of mouse pointer.
-
警告
-
Should only be called from the main thread.
-
参数
-
[in]
|
v
|
The mouse pointer:
MOUSE
|
◆
GeGetScreenDimensions()
Retrieves the screen dimensions in pixels.
-
参数
-
[in]
|
x
|
The screen X coordinates to identify which display information is read (for multi-display setups).
|
[in]
|
y
|
The screen Y coordinates to identify which display information is read (for multi-display setups).
|
[in]
|
whole_screen
|
true
if dimensions of the whole screen (including task bar etc.) are returned, otherwise
false
.
|
[out]
|
sx1
|
Assigned the minimum X coordinate (left).
|
[out]
|
sy1
|
Assigned the minimum Y coordinate (top).
|
[out]
|
sx2
|
Assigned the maximum X coordinate (right).
|
[out]
|
sy2
|
Assigned the maximum Y coordinate (bottom).
|
-
返回
-
true
if successful, otherwise
false
.
◆
GeGetTimer()
Int32
GeGetTimer
|
(
|
void
|
|
)
|
|
Retrieves the current timer count in milliseconds.
-
返回
-
The current timer count in milliseconds.
◆
GeGetMilliSeconds()
Get the current timer count in milliseconds.
-
返回
-
The current timer count in milliseconds.
◆
GeGetLineEnd()
Retrieves a string that contains the type of line ending characters for the running OS.
-
返回
-
The type of line ending.
◆
GeGetDefaultFPS()
Int32
GeGetDefaultFPS
|
(
|
void
|
|
)
|
|
Retrieves the default frames per second.
-
返回
-
The default FPS value.
◆
GeGetCinemaInfo()
Retrieves information about
Cinema 4D
's application runtime.
-
参数
-
-
返回
-
The
Cinema 4D
's information.
◆
GeOutString()
Displays a message box with the string as the text.
-
参数
-
[in]
|
str
|
The dialog box message.
|
[in]
|
flags
|
The flags:
GEMB
|
-
返回
-
The result from the message box:
GEMB_R
◆
GeGetCurrentOS()
Retrieves the type of OS that is running
Cinema 4D
.
-
返回
-
The OS running:
OPERATINGSYSTEM
◆
GeGetByteOrder()
Retrieves the byte order for the platform that
Cinema 4D
is running on.
-
返回
-
The byte order:
BYTEORDER
◆
GeGetGray()
Retrieves the color values for the default
Cinema 4D
gray.
-
参数
-
[out]
|
r
|
Assigned the red component of the gray color.
|
[out]
|
g
|
Assigned the green component of the gray color.
|
[out]
|
b
|
Assigned the blue component of the gray color.
|
◆
GeChooseColor()
Opens a color chooser dialog for the user to select a color.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
GeChooseColorAlpha()
Opens a color chooser dialog for the user to select a color with alpha.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
GeOpenHTML()
Opens a URL in the user's default web browser.
-
注意
-
The passed URL string has to be spec conform, see
IETF - Uniform Resource Locators
.
-
参数
-
[in]
|
webaddress
|
The URL to open.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GeChooseFont()
Opens a font chooser dialog for the user to select a font.
-
参数
-
[in]
|
bc
|
Assigned the selected font settings.
|
-
返回
-
true
if a new font was chosen, otherwise
false
.
◆
GeGetGuiFont()
void GeGetGuiFont
|
(
|
maxon::OSFontDefinition &
|
out
|
)
|
|
Internal
. Returns the c4d UI font.
◆
GeGetMonoFont()
void GeGetMonoFont
|
(
|
maxon::OSFontDefinition &
|
out
|
)
|
|
Internal
. Returns the c4d monospaced font.
◆
GeRegisterPlugin()
Deprecated
. Use the individual functions for each plugin type instead.
See Plugin Types.
◆
GePrint()
Outputs a string to the
Cinema 4D
console window. This routine is deprecated - use
maxon::Application
instead, which has an improved interface.
-
参数
-
[in]
|
str
|
The string to display in the console window.
|
◆
GeConsoleOut()
Outputs a string to the
Cinema 4D
debug console window.
This reoutine is deprecated - use maxon::DiagnosticOutput instead, which has an improved interface. See Debug Information.
-
参数
-
[in]
|
str
|
The string to display in the debug console window.
|
◆
GeGetMovieInfo()
Retrieves information from a movie file.
-
参数
-
[in]
|
fn
|
The filename of the movie file to retrieve the information from.
|
[out]
|
frames
|
Assigned the number of frames.
|
[out]
|
fps
|
Assigned the number of frames per second.
|
-
返回
-
true
if successful, otherwise
false
.
◆
RenameDialog()
Opens a standard rename dialog.
-
参数
-
[in,out]
|
str
|
The string with the name to change. Assigned the new name. The caller owns the pointed string.
|
-
返回
-
true
if the name was changed, otherwise
false
.
◆
GetC4DVersion()
Int32
GetC4DVersion
|
(
|
void
|
|
)
|
|
Retrieves the version of
Cinema 4D
that is running.
-
返回
-
The version of
Cinema 4D
.
◆
GeGetDegreeChar()
Retrieves the degree character (°).
-
返回
-
A string containing the degree character.
◆
GeGetPercentChar()
Retrieves the percent character (%).
-
返回
-
A string containing the percent character.
◆
lSwap()
void lSwap
|
(
|
void *
|
adr
,
|
|
|
Int
|
cnt
=
1
|
|
)
|
|
|
Swaps the bytes of
Int
values. (Converting between big endian and little endian.)
-
参数
-
[in]
|
adr
|
The address of the memory. The caller owns the pointed memory buffer or variable at
adr
.
|
[in]
|
cnt
|
The number of elements in the memory buffer at
adr
(
1
for a single element or variable).
|
◆
wSwap()
void wSwap
|
(
|
void *
|
adr
,
|
|
|
Int
|
cnt
=
1
|
|
)
|
|
|
Swaps the low and high bytes of
UInt
values. (Converting between big endian and little endian.)
-
参数
-
[in]
|
adr
|
The address of the memory. The caller owns the pointed memory buffer or variable at
adr
.
|
[in]
|
cnt
|
The number of elements in the memory buffer at
adr
(
1
for a single element or variable).
|
◆
lIntel()
void lIntel
|
(
|
void *
|
adr
,
|
|
|
Int
|
cnt
=
1
|
|
)
|
|
|
转换
Int
values to Intel format. If already in Intel (i.e on a PC) the values remain unchanged.
-
参数
-
[in]
|
adr
|
The address of the memory. The caller owns the pointed memory buffer or variable at
adr
.
|
[in]
|
cnt
|
The number of elements in the memory buffer at
adr
(
1
for a single element or variable).
|
◆
wIntel()
void wIntel
|
(
|
void *
|
adr
,
|
|
|
Int
|
cnt
=
1
|
|
)
|
|
|
Converts
UInt
values to Intel format. If already in Intel (i.e on a PC) the values remain unchanged.
-
参数
-
[in]
|
adr
|
The address of the memory. The caller owns the pointed memory buffer or variable at
adr
.
|
[in]
|
cnt
|
The number of elements in the memory buffer at
adr
(
1
for a single element or variable).
|
◆
lMotor()
void lMotor
|
(
|
void *
|
adr
,
|
|
|
Int
|
cnt
=
1
|
|
)
|
|
|
Converts
Int
values to Motorola format. If already in Motorola (i.e on a Mac) the values remain unchanged.
-
参数
-
[in]
|
adr
|
The address of the memory. The caller owns the pointed memory buffer or variable at
adr
.
|
[in]
|
cnt
|
The number of elements in the memory buffer at
adr
(
1
for a single element or variable).
|
◆
wMotor()
void wMotor
|
(
|
void *
|
adr
,
|
|
|
Int
|
cnt
=
1
|
|
)
|
|
|
转换
UInt
values to Motorola format. If already in Motorola (i.e on a Mac) then the values remain unchanged.
-
参数
-
[in]
|
adr
|
The address of the memory. The caller owns the pointed memory buffer or variable at
adr
.
|
[in]
|
cnt
|
The number of elements in the memory buffer at
adr
(
1
for a single element or variable).
|
◆
llSwap()
void llSwap
|
(
|
void *
|
adr
,
|
|
|
Int
|
cnt
=
1
|
|
)
|
|
|
Swaps the bytes of
Int64
values. (Converting between big endian and little endian.)
-
参数
-
[in]
|
adr
|
The address of the memory. The caller owns the pointed memory buffer or variable at
adr
.
|
[in]
|
cnt
|
The number of elements in the memory buffer at
adr
(
1
for a single element or variable).
|
◆
llIntel()
void llIntel
|
(
|
void *
|
adr
,
|
|
|
Int
|
cnt
=
1
|
|
)
|
|
|
Converts
Int64
values to Intel format. If already in Intel (i.e on a PC) the values remain unchanged.
-
参数
-
[in]
|
adr
|
The address of the memory. The caller owns the pointed memory buffer or variable at
adr
.
|
[in]
|
cnt
|
The number of elements in the memory buffer at
adr
(
1
for a single element or variable).
|
◆
llMotor()
void llMotor
|
(
|
void *
|
adr
,
|
|
|
Int
|
cnt
=
1
|
|
)
|
|
|
Converts
Int64
values to Motorola format. If already in Motorola (i.e on a Mac) the values remain unchanged.
-
参数
-
[in]
|
adr
|
The address of the memory. The caller owns the pointed memory buffer or variable at
adr
.
|
[in]
|
cnt
|
The number of elements in the memory buffer at
adr
(
1
for a single element or variable).
|
◆
GeAddBackgroundHandler()
Adds a background handler with the given
typeclass
and
priority
. Remove it with
GeRemoveBackgroundHandler()
.
A background handler is a hook that
Cinema 4D
processes when idle.
The advantage over a regular thread or timer is that it always will be called at a certain position. As a result it will not block other
Cinema 4D
operations (noticeable slowdown).
Cinema 4D
itself uses background handler for example to redraw the view if it was stopped, to render material previews, to update the material preview in AM & MM, to draw the ants in
BodyPaint 3D
etc.
-
警告
-
Background handlers must only be used if you know exactly what you are doing. They need to be thoroughly tested since a bug introduced can mess up the whole application's behavior.
-
参数
-
[in]
|
handler
|
The background handler.
|
[in]
|
tdata
|
The private data. This will be passed on to the handler.
|
[in]
|
typeclass
|
A unique plugin ID. Must be obtained from
http://www.plugincafe.com
There can be many handlers with the same class as long as they have different
tdata
.
|
[in]
|
priority
|
The handler priority. Higher absolute values are evaluated before lower. A negative value means that it does not block positive priorities.
范例:
#define BACKGROUNDHANDLER_PRIORITY_RENDERACTIVEMATERIAL 5000
#define BACKGROUNDHANDLER_PRIORITY_REDRAWVIEW 4000
#define BACKGROUNDHANDLER_PRIORITY_RENDERINACTIVEMATERIALS 3000
#define BACKGROUNDHANDLER_PRIORITY_RENDEREXTERNAL -1000
#define BACKGROUNDHANDLER_PRIORITY_REDRAWANTS -2000
#define BACKGROUNDHANDLER_PRIORITY_PREVIEWCACHE 6000
#define BACKGROUNDHANDLER_PRIORITY_PREVIEWCACHE_ANIMATION 2000
#define BACKGROUNDHANDLER_PRIORITY_PREVIEWCACHE_ASYNC 3500
The external render thread (output window) does not block the editor display.
However, if e.g. an inactive material is being rendered the view will not be redrawn until the other thread finishes.
|
◆
GeRemoveBackgroundHandler()
Bool
GeRemoveBackgroundHandler
|
(
|
void *
|
tdata
,
|
|
|
Int32
|
typeclass
|
|
)
|
|
|
Removes background handlers added with
GeAddBackgroundHandler()
.
-
参数
-
[in]
|
tdata
|
The registered data.
|
[in]
|
typeclass
|
The registered type class ID.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GeStopBackgroundThreads()
Stops all running background threads of the given
typeclass
。若
typeclass
==
0
all threads are stopped.
-
参数
-
[in]
|
typeclass
|
The type class ID to stop, or
0
for all classes.
|
[in]
|
flags
|
若
typeclass
is
BACKGROUNDHANDLER_TYPECLASS_C4D
then the flags have the following meaning:: BACKGROUNDHANDLERFLAGS
For own type classes define flags as needed, they will be routed to the background handler function.
For example
GeStopBackgroundThreads(BACKGROUNDHANDLER_TYPECLASS_C4D, BACKGROUNDHANDLER_FLAGS_EDITORRENDDER)
will only stop the editor renderer (if it was running).
GeStopBackgroundThreads(0, BACKGROUNDHANDLERFLAGS::SHUTDOWN)
will kill anything running.
|
[in]
|
thread
|
Optional thread or nullptr. If passed the return value can be false if the thread is stopped while it is trying to acquire the resources for this call.
|
◆
GeCheckBackgroundThreadsRunning()
Bool
GeCheckBackgroundThreadsRunning
|
(
|
Int32
|
typeclass
,
|
|
|
Bool
|
all
|
|
)
|
|
|
Checks if any of the background threads matching
typeclass
is running. If
typeclass
==
0
all threads are checked.
For example
GeCheckBackgroundThreadsRunning(BACKGROUNDHANDLER_TYPECLASS_C4D, true)
checks if
Cinema 4D
is doing anything right now.
若
all
=
false
was passed it would not check for the external renderer and ants (which are always running in a
BodyPaint 3D
selection).
-
参数
-
[in]
|
typeclass
|
The type class ID to check, or
0
for all classes.
|
[in]
|
all
|
若
true
, negative priorities are also checked.
|
-
返回
-
true
if the specified background threads are running, otherwise
false
.
◆
SetMousePointer()
void SetMousePointer
|
(
|
Int32
|
l
|
)
|
|
Sets the type of mouse pointer.
-
参数
-
[in]
|
l
|
The mouse pointer:
MOUSE
|
◆
ShowBitmap()
[1/2]
Displays a bitmap into the Picture Viewer.
-
警告
-
Must be called from the main thread.
-
参数
-
[in]
|
fn
|
The filename of the bitmap to display.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ShowBitmap()
[2/2]
Displays a bitmap into the Picture Viewer.
-
注意
-
The bitmap will be copied for display.
-
警告
-
Must be called from the main thread.
-
参数
-
[in]
|
bm
|
The bitmap to display.
|
-
返回
-
true
if successful, otherwise
false
.
◆
StopAllThreads()
void StopAllThreads
|
(
|
void
|
|
)
|
|
Stops all running threads.
-
注意
-
Be sure to call this routine always when a document is modified asynchronously.
◆
StopDrawViewsThread()
void StopDrawViewsThread
|
(
|
|
)
|
|
Stops all draw views thread.
-
注意
-
Be sure to call this routine always when a document is modified asynchronously.
◆
ShutdownThreads()
Private
.
◆
StatusClear()
void StatusClear
|
(
|
void
|
|
)
|
|
Clears the status bar text.
◆
StatusSetSpin()
void StatusSetSpin
|
(
|
void
|
|
)
|
|
Sets the status bar progress bar spinning. Needs to be triggered for every spin step.
Use this to indicate that a plugin is still processing even if the progress bar is not increasing.
◆
StatusSetBar()
void StatusSetBar
|
(
|
Int32
|
p
|
)
|
|
Sets the status bar progress bar.
-
参数
-
[in]
|
p
|
The percentage of the progress (
0-
100
)
.
|
◆
StatusSetText()
Sets the status bar text.
-
参数
-
[in]
|
str
|
The text to display.
|
◆
StatusNetClear()
void StatusNetClear
|
(
|
void
|
|
)
|
|
Clears the NET status bar text.
-
警告
-
Reserved for Team Render and should not be used externally.
◆
StatusSetNetLoad()
Sets the NET status bar to
status
state.
-
警告
-
Reserved for Team Render and should not be used externally.
-
参数
-
◆
StatusSetNetBar()
Sets the NET status bar progress and custom color.
-
警告
-
Reserved for Team Render and should not be used externally.
-
参数
-
[in]
|
p
|
The percentage of the progress (
0-
100
)
.
|
[in]
|
dat
|
The color for the NET status bar. Can be a color constant
COLOR_BG
,
COLOR_TEXT
, etc. or a color Vector.
|
◆
StatusSetNetText()
Sets the NET status bar text.
-
警告
-
Reserved for Team Render and should not be used externally.
-
参数
-
[in]
|
str
|
The text to display.
|
◆
SpecialEventAdd()
void SpecialEventAdd
|
(
|
Int32
|
messageid
,
|
|
|
UInt
|
p1
=
0
,
|
|
|
UInt
|
p2
=
0
|
|
)
|
|
|
Adds a custom event. Results in a
CoreMessage()
.
-
另请参阅
-
The article
Core Messages
了解更多信息。
-
参数
-
[in]
|
messageid
|
The message ID. A unique plugin ID. Must be obtained from
http://www.plugincafe.com
Use a unique plugin ID to make sure that there is no collision.
|
[in]
|
p1
|
The first private data for the sent message.
|
[in]
|
p2
|
The second private data for the sent message.
|
◆
EventAdd()
Adds a global event to
Cinema 4D
's event queue. Results in a
CoreMessage()
.
-
另请参阅
-
The article
Core Messages
了解更多信息。
-
参数
-
[in]
|
eventflag
|
The event to add:
EVENT
|
◆
GeSyncMessage()
Sends a synchronous event message (for example to make the Timeline, Timeslider etc. do an instant redraw).
-
参数
-
[in]
|
messageid
|
The synchronous message to send:
EVMSG
|
[in]
|
destid
|
Private
.
|
[in]
|
p1
|
Private
.
|
[in]
|
p2
|
Private
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
DrawViews()
Redraws the editor views.
-
注意
-
Cannot be used while a modal dialog is open.
-
警告
-
Must be called from the main thread.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
SendModelingCommand()
Sends a modeling command.
范例:
ModelingCommandData
cd;
cd.
doc
= doc;
cd.
op
= op;
if
(!
SendModelingCommand
(
MCOMMAND_CURRENTSTATETOOBJECT
, cd))
return
false
;
res =
static_cast<
BaseObject
*
>
(cd.
result
->
GetIndex
(0));
BaseContainer
bc;
bc.
SetFloat
(
MDATA_SPLINE_CHAMFERRADIUS
, 100.0);
ModelingCommandData
cd;
cd.
doc
= doc;
cd.
bc
= &bc;
cd.
op
= op;
if
(!
SendModelingCommand
(MCOMMAND_SPLINE_CHAMFER, cd))
return
false
;
-
注意
-
It is usually not possible to use
SendModelingCommand()
during ModifyObject() or similarly functions.
The object needs to be cloned (or put into a different document). The problem is that
SendModelingCommand()
rebuilds the caches, invalidating all the view caches.
-
参数
-
[in]
|
命令
|
There are several groups of IDs to use.
First there are the internal modeling commands: (IDs are for
ModelingCommandData::bc
.)
MCOMMAND
Then there are the modeling library tool IDs, look up the parameters in the resource files: ModelingToolsParameters
Finally there are the modeling library menu commands. (These have no parameters.)
ModelingToolsNoParameters
|
[in]
|
data
|
The data for the command. Can be filled with the result for some commands.
|
-
返回
-
true
if the command was executed, otherwise
false
.
◆
GetGlobalTexturePaths()
Retrieves the global texture paths.
-
参数
-
[in]
|
docPath
|
The path of the document. This will be used to complete relative texture paths.
Pass nullptr if you want to get the unmodified paths only.
|
-
返回
-
The global texture paths for
Cinema 4D
.
◆
SetGlobalTexturePaths()
Sets the global texture paths.
◆
GenerateTexturePath()
Generates the texture filename for a given texture image.
-
参数
-
[in]
|
docpath
|
The filename of the document for the texture.
|
[in]
|
srcname
|
The filename of the image.
|
[in]
|
suggestedfolder
|
A suggested folder path for the image. Can be an empty
Filename
.
|
[out]
|
dstname
|
Assigned the generated path.
|
[in]
|
service
|
An optional NET render service for the operation. The caller owns the pointed service.
|
[in]
|
bt
|
An optional thread for the operation. The caller owns the pointed thread.
|
-
返回
-
true
if successful, otherwise
false
.
◆
IsInSearchPath()
Checks if the texture
texfilename
is in the search path for files located in
docpath
.
-
注意
-
The function only performs string comparisons between
texfilename
and
docpath
.
-
参数
-
[in]
|
texfilename
|
The texture file name.
|
[in]
|
docpath
|
The document path.
|
-
返回
-
true
if the texture file is in the search path, otherwise
false
.
◆
FlushTexture()
Flushes the given texture.
-
参数
-
[in]
|
docpath
|
The filename of the document with the texture.
|
[in]
|
name
|
The name of the texture to flush.
|
[in]
|
suggestedfolder
|
A suggested folder path for the image. Can be an empty
Filename
.
|
◆
FlushUnusedTextures()
void FlushUnusedTextures
|
(
|
void
|
|
)
|
|
Flushes all unused textures.
◆
GetWorldContainer()
Retrieves the main
Cinema 4D
settings container.
-
返回
-
The main
Cinema 4D
settings:
WPREF
◆
GetWorldContainerInstance()
Retrieves the main
Cinema 4D
settings container that can be changed directly.
-
注意
-
There are a few settings that are transferred to the world container within the call
GetWorldContainer()
, for example
WPREF_UNITS_BASIC
to WPREF_COLOR_SYSTEM_COLORCHOOSER.
These settings cannot be set using
GetWorldContainerInstance()
. To read only these values, use GetAdditionalWorldContainerData.
-
返回
-
The main
Cinema 4D
settings:
WPREF
◆
GetAdditionalWorldContainerData()
Gets additional world container data (see GetWorldContainerInstance).
-
参数
-
[out]
|
bc
|
A container which receives the data. the container is not cleared before data is written.
|
◆
GetRecentDocumentsList()
Retrieves the recent documents list.
-
参数
-
[in]
|
isBodyPaint
|
Set to reteive BodyPaint's list.
|
-
返回
-
The recent documents list.
◆
GetActiveNodeSpaceId()
Returns the active node space. This is a program-wide global UI setting.
-
返回
-
The Id of the current node space.
◆
SaveWorldPreferences()
void SaveWorldPreferences
|
(
|
|
)
|
|
Saves the main
Cinema 4D
preferences.
◆
SetWorldContainer()
Sets the main
Cinema 4D
settings container.
见
GetWorldContainer()
for values.
-
参数
-
[in]
|
bc
|
The settings container.
|
◆
GetViewColor()
向量
GetViewColor
|
(
|
Int32
|
colid
,
|
|
|
向量
*
|
defaultColor
=
nullptr
|
|
)
|
|
|
Retrieves a main
Cinema 4D
color.
-
参数
-
[in]
|
colid
|
The color ID to get:
VIEWCOLOR
|
[in]
|
defaultColor
|
Pass a valid pointer to get the default color.
|
-
返回
-
The color value.
◆
SetViewColor()
void SetViewColor
|
(
|
Int32
|
colid
,
|
|
|
const
向量
&
|
col
|
|
)
|
|
|
Sets one of the main
Cinema 4D
colors.
-
参数
-
[in]
|
colid
|
The color ID to set:
VIEWCOLOR
|
[in]
|
col
|
The new color.
|
◆
ErrorStringDialog()
Displays an error dialog for incorrectly entered values.
-
参数
-
◆
ReadPluginInfo()
Reads private serial information for a plugin.
Cinema 4D
will store this data encrypted.
-
参数
-
[in]
|
pluginid
|
A unique plugin ID. Must be obtained from
http://www.plugincafe.com
|
[in]
|
buffer
|
The buffer to take the data.
|
[in]
|
size
|
The size of the buffer. This must not exceed
3500
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
WritePluginInfo()
-
参数
-
[in]
|
pluginid
|
A unique plugin ID. Must be obtained from
http://www.plugincafe.com
|
[in]
|
buffer
|
The buffer with the data.
|
[in]
|
size
|
The size of the buffer. This must not exceed
3500
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ReadRegInfo()
Reads user-specific data (e.g. login data for a user account).
-
注意
-
Use this method instead of
ReadPluginInfo()
in a license server environment.
-
参数
-
[in]
|
pluginid
|
A unique plugin ID. Must be obtained from
http://www.plugincafe.com
|
[in]
|
buffer
|
The data buffer. The caller owns the pointed buffer.
|
[in]
|
size
|
The buffer size.
|
-
返回
-
true
if successful, otherwise
false
.
◆
WriteRegInfo()
Writes user-specific data (e.g. login data for a user account).
-
注意
-
Use this method instead of
WritePluginInfo()
in a license server environment.
-
参数
-
[in]
|
pluginid
|
A unique plugin ID. Must be obtained from
http://www.plugincafe.com
|
[in]
|
buffer
|
The data buffer. The caller owns the pointed buffer.
|
[in]
|
size
|
The buffer size.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetWorldPluginData()
Retrieves a container stored with
SetWorldPluginData()
从
Cinema 4D
preferences.
-
注意
-
This can be used by any plugin to store preferences.
-
参数
-
[in]
|
id
|
The plugin ID that the container was stored with.
|
-
返回
-
The retrieved container.
Cinema 4D
owns the pointed container.
◆
SetWorldPluginData()
Stores a container in the
Cinema 4D
preferences.
-
注意
-
This can be used by any plugin to store preferences.
-
参数
-
[in]
|
id
|
The plugin ID that the container should be associated with.
|
[in]
|
bc
|
The container to set.
|
[in]
|
add
|
若
true
, the container values are merged with the ones currently stored for the ID. Otherwise the previous values are lost.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetToolPluginData()
Retrieves a tool plugin container stored in a document.
-
参数
-
[in]
|
doc
|
The document. The caller owns the pointed document.
|
[in]
|
id
|
The tool plugin ID.
|
-
返回
-
The retrieved tool plugin container.
◆
GeIsActiveToolEnabled()
Bool
GeIsActiveToolEnabled
|
(
|
void
|
|
)
|
|
Checks if the active tool is ghosted.
-
返回
-
true
if the active tool is not ghosted, otherwise
false
.
◆
GetActiveTool()
Gets the active tool.
Private
.
-
由于
-
R19
-
返回
-
The active tool.
◆
GeGetLanguage()
Enumerates information about the available languages.
Start with
index
==
0
and then iterate with
index
++ until the function returns
false
.
-
参数
-
[in]
|
index
|
The language index.
|
[out]
|
extension
|
Assigned the language extension.
|
[out]
|
name
|
Assigned the human readable language name.
|
[out]
|
default_language
|
Assigned
true
if this is the default language, otherwise
false
.
|
-
返回
-
true
if there was a language at
index
, otherwise
false
.
◆
GeFilterSetSuffix()
Sets the standard suffix of a given bitmap saver plugin.
e.g. if
name
is
"C:\test"
and
id
is
1106
(Photoshop PSD) then the returned
Filename
will be
"C:\test.psd"
.
-
参数
-
[in]
|
name
|
The filename.
|
[in]
|
id
|
The ID of the bitmap saver plugin.
|
-
返回
-
The given file
name
with the concatenated suffix.
◆
GeIdentifyFile()
Identifies the file in
name
.
-
参数
-
[in]
|
name
|
The file to check.
|
[in]
|
probe
|
The start of a small chunk of data from the start of the file for testing this file type.
Usually the probe size is
1024
bytes. The caller owns the pointed data.
|
[in]
|
probesize
|
The size of the
probe
array.
|
[in]
|
recognition
|
The identification flags:
IDENTIFYFILE
|
[in]
|
bp
|
For image formats this is filled with a pointer to the image loader that was identified.
|
-
返回
-
The identification result:
IDENTIFYFILE
◆
GetScriptHead()
Retrieves the list head for scripts (ID_COFFEESCRIPT).
-
参数
-
[in]
|
type
|
Currently
0
is user scripts and
1
is system scripts.
The user scripts are located in library/scripts whereas system scripts are in resource/scripts.)
|
-
返回
-
The script list head.
Cinema 4D
owns the pointed list head.
◆
GetDynamicScriptID()
Retrieves the dynamic ID of the ID_COFFEESCRIPT script
bl
.
Every script gets a dynamic ID when loaded, which is just like a regular plugin ID.
This is necessary in many parts of the program. It is only when loading and saving the scripts that the unique (script) names are used; the ID is created dynamically at loading time.
-
参数
-
[in]
|
bl
|
The script to get the ID for. The caller owns the pointed script.
|
-
返回
-
The dynamic script ID.
◆
GetCommandLineArgs()
Retrieves the command line arguments used to start
Cinema 4D
in args.
-
注意
-
Linux only.
-
参数
-
[in]
|
args
|
Filled with the command line arguments.
|
-
返回
-
true
if the command line arguments could be retrieved, otherwise
false
.
◆
GetObjectName()
Retrieves a user presentable name from an object type ID. For example
GetObjectName(Onull)
returns
"Null"
.
-
参数
-
[in]
|
type
|
An object type ID.
|
-
返回
-
The object name for
type
.
◆
GetTagName()
Retrieves a user presentable name from a tag type ID.
-
参数
-
-
返回
-
The tag name for
type
.
◆
GetObjectType()
The inverse of
GetObjectName()
. Returns an object type from an object name.
-
参数
-
[in]
|
name
|
An object name.
|
-
返回
-
The object type for
name
.
◆
GetTagType()
The inverse of
GetTagName()
. Returns a tag type from a tag
name
.
-
参数
-
-
返回
-
The tag type for
name
.
◆
GeRegistryAdd()
Private
.
◆
GeRegistryRemove()
Private
.
◆
GeRegistryFind()
Private
.
◆
GeRegistryGetLast()
Private
.
◆
GeRegistryGetFirst()
Private
.
◆
GeRegistryGetAutoID()
Private
.
◆
GePluginMessage()
Bool
GePluginMessage
|
(
|
Int32
|
id
,
|
|
|
void *
|
data
|
|
)
|
|
|
Sends a plugin message to other plugins. These messages can be received with
PluginMessage()
. The message is sent to all plugin modules.
-
参数
-
[in]
|
id
|
The ID of the message.
|
[in]
|
data
|
The message data. It is highly recommended as caller to own the pointed object and to not rely on the receiver to take the ownership.
|
-
返回
-
true
if the message could be sent, otherwise
false
.
◆
CheckIsRunning()
Checks if a task is running.
-
参数
-
-
返回
-
true
if the task running, otherwise
false
.
◆
GeGetDefaultFilename()
Retrieves the default filename for a category.
In the following example the name
DEFAULTFILENAME_SHADER_VOLUME
is placed in front of the shader name, placing the material in the Shader category:
RegisterMaterialPlugin
(Mmy,
GeGetDefaultFilename
(
DEFAULTFILENAME_SHADER_VOLUME
)+
String
(
"MyMaterial"
), 0, MyClass::Alloc,
"Mmy"
, 0);
-
参数
-
-
返回
-
The filename to prepend to the material name.
◆
FindInManager()
Finds and makes
bl
visible in its manager.
-
参数
-
[in]
|
bl
|
The object to find. The caller owns the pointed object.
|
◆
GeSleep()
void GeSleep
|
(
|
Int32
|
milliseconds
|
)
|
|
Sleeps for
milliseconds
ms.
Deprecated
. Do not use for idle loops. Wait()/GetResult() for condition variables/jobs/threads must be used.
-
参数
-
[in]
|
milliseconds
|
The time to sleep in milliseconds.
|
◆
GeIsMainThread()
Checks if code is run from within the main thread of
Cinema 4D
.
-
返回
-
true
if called from the main thread, otherwise
false
.
◆
GeIsMainThreadAndNoDrawThread()
Bool
GeIsMainThreadAndNoDrawThread
|
(
|
|
)
|
|
Checks if code is run from within the main thread of
Cinema 4D
and if the main thread does not execute any drawing code currently.
-
由于
-
R16.038
-
注意
-
This routine can be used to make sure that no illegal code is called during a drawing operation.
在
Cinema 4D
the drawing will be started threaded or non-threaded, depending on the situation.
It is not allowed to add e.g. undos or delete objects or materials while the drawing is in progress (this would lead to immediate crashes).
If your code calls other routines that are not aware of their context (e.g. some code within a Message that does not know whether it was called from a drawing thread or during a command call)
GeIsMainThreadAndNoDrawThread()
can be used to detect the correct situation.
-
返回
-
true
if called from the main thread and main thread does not execute a drawing operation, otherwise
false
.
◆
_GeDebugBreak()
void _GeDebugBreak
|
(
|
Int32
|
line
,
|
|
|
const
Char
*
|
file
|
|
)
|
|
|
Private
.
◆
GeDebugOut()
[1/2]
void GeDebugOut
|
(
|
const
Char
*
|
s
,
|
|
|
|
...
|
|
)
|
|
|
Prints a string to the debug console using
vsprintf()
syntax.
-
注意
-
Requires that the API is build in debug mode i.e.
MAXON_TARGET_DEBUG
is defined.
-
参数
-
[in]
|
s
|
The string to print. Limited to
2048
characters.
Following parameters are format for
vsprintf()
.
|
◆
GeDebugOut()
[2/2]
Prints a string to the debug console.
-
注意
-
Requires that the API is build in debug mode i.e.
MAXON_TARGET_DEBUG
is defined.
-
参数
-
[in]
|
s
|
The string to print. Limited to
2048
characters.
|
◆
SendCoreMessage()
Sends a core message.
-
另请参阅
-
The article
Core Messages
了解更多信息。
范例:
// Check if command id is enabled
BaseContainer
msg(
COREMSG_CINEMA_GETCOMMANDENABLED
);
msg.
SetInt32
(
COREMSG_CINEMA_GETCOMMANDENABLED
,
id
);
Bool
enabled =
SendCoreMessage
(
COREMSG_CINEMA
, msg, 0).
GetInt32
();
// Get the machine features
GeData
data =
SendCoreMessage
(
COREMSG_CINEMA
,
BaseContainer
(
COREMSG_CINEMA_GETMACHINEFEATURES
), 0);
BaseContainer
* bc = data.
GetContainer
();
// Execute an editor command
BaseContainer
msg(
COREMSG_CINEMA_EXECUTEEDITORCOMMAND
);
msg.
SetInt32
(
COREMSG_CINEMA_EXECUTEEDITORCOMMAND
,
id
);
msg.
SetInt32
(
COREMSG_CINEMA_EXECUTESUBID
, subid);
SendCoreMessage
(
COREMSG_CINEMA
, msg, 0);
// Execute the options dialog of an editor command
BaseContainer
msg(
COREMSG_CINEMA_EXECUTEEDITORCOMMAND
);
msg.
SetInt32
(
COREMSG_CINEMA_EXECUTEEDITORCOMMAND
, cmdID);
msg.
SetInt32
(
COREMSG_CINEMA_EXECUTESUBID
, subID);
msg.
SetInt32
(
COREMSG_CINEMA_EXECUTEOPTIONMODE
,
true
);
// true to open the options dialog
SendCoreMessage
(
COREMSG_CINEMA
, msg, 0);
-
参数
-
[in]
|
coreid
|
The core message ID:
COREMSG_CINEMA
.
|
[in]
|
msg
|
The message container:
COREMSG
|
[in]
|
eventid
|
The event ID.
|
-
返回
-
The data.
◆
GetMacModel()
On a Mac
GetMachineFeatures()
.GetString(MACHINEINFO_MACHINEMODEL) returns the model name which is set in the OS like
"iMac4,1"
or
"MacBookPro8,2"
.
If this string is pass to
GetMacModel()
a much more human readable string like
"iMac Intel Core 2 Duo (aluminum enclosure) (Mid 2007)"
or
"MacBook Pro Intel Core i5, Intel Core i7, 13 (Early 2011)"
.
-
参数
-
[in]
|
machinemodel
|
The machine model returned by
GetMachineFeatures()
.GetString(MACHINEINFO_MACHINEMODEL).
|
-
返回
-
The Mac model.
◆
GetMachineFeatures()
Retrieves the features of the computer.
-
参数
-
[in]
|
type
|
The machine features type: MACHINEFEATURESTYPE
Since R18.
|
-
返回
-
The container with the machine features:
MACHINEINFO
OPENGL
◆
GeGetMemoryStat()
Retrieves
Cinema 4D
memory statistics.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
PopupEditText()
Opens a small popup window at (
screenx
,
screeny
) where the user can edit the
changeme
string. The result is reported to the
func
callback.
-
参数
-
[in]
|
screenx
|
The X screen coordinate of the window.
|
[in]
|
screeny
|
The Y screen coordinate of the window.
|
[in]
|
width
|
The width of the window.
|
[in]
|
height
|
The height of the window.
|
[in,out]
|
changeme
|
The string to change.
|
[in]
|
func
|
The callback function.
|
-
返回
-
true
if the popup edit text could be opened, otherwise
false
.
◆
StartEditorRender()
Starts the editor renderer.
-
参数
-
[in]
|
active_only
|
true
for active object only.
|
[in]
|
raybrush
|
true
for ray brush mode.
|
[in]
|
x1
|
The X coordinate of the first corner of the render rectangle.
|
[in]
|
y1
|
The Y coordinate of the first corner of the render rectangle.
|
[in]
|
x2
|
The X coordinate of the second corner of the render rectangle.
|
[in]
|
y2
|
The Y coordinate of the second corner of the render rectangle.
|
[in]
|
bt
|
The thread for the operation. The caller owns the pointed thread.
|
[in]
|
bd
|
The view to draw to. The caller owns the pointed view.
|
[in]
|
newthread
|
若
true
, then the editor render is done asynchronously. In that case pass
nullptr
for the thread.
|
◆
FormatNumber()
Converts
val
to a string.
-
参数
-
[in]
|
val
|
The value to convert to a string. Must be of type
Float
,
Int32
or
BaseTime
.
|
[in]
|
format
|
The format:
FORMAT_NUMBERS
|
[in]
|
fps
|
The frames per second, for time values.
|
[in]
|
bUnit
|
若
true
the unit is included in the formatted string.
|
-
返回
-
The formatted string.
◆
StringToNumber()
Converts a string to a data value of type
Float
,
Int32
or
BaseTime
.
-
参数
-
[in]
|
text
|
The string to convert to a value.
|
[in]
|
format
|
The format:
FORMAT_NUMBERS
|
[in]
|
fps
|
The frames per second, for time values.
|
[in]
|
lengthunit
|
Can be used to override the units conversion. By default it will use the document's units.
For example a string of
"50"
will result in
0.5
if the document's units are Meters and the unit display setting is centimeters.
若
lengthunit
is specified its value will be used instead of the document's units setting.
|
-
返回
-
The converted value.
◆
CallCommand()
Executes commands.
-
参数
-
[in]
|
id
|
The command ID.
|
[in]
|
subid
|
The sub ID. (Used for scripts.)
|
◆
GetCommandName()
Gets the name of a command.
-
参数
-
-
返回
-
The command name.
◆
GetCommandHelp()
Gets the help string of a command.
-
参数
-
[in]
|
id
|
The ID of the command.
|
-
返回
-
The help string.
◆
IsCommandEnabled()
Checks if a command is enabled.
-
参数
-
[in]
|
id
|
The ID of the command.
|
-
返回
-
true
if the command is enabled, otherwise
false
.
◆
IsCommandChecked()
Checks if a command is checked.
-
参数
-
[in]
|
id
|
The ID of the command.
|
-
返回
-
true
if the command is checked, otherwise
false
.
◆
GetSystemEnvironmentVariable()
Retrieves system environment variables.
-
参数
-
[in]
|
varname
|
The environment variable name.
|
[out]
|
result
|
Assigned the retrieved value, if available.
|
-
返回
-
true
if successful, otherwise
false
.
◆
AskForAdministratorPrivileges()
Private
.
◆
EndAdministratorPrivileges()
void EndAdministratorPrivileges
|
(
|
|
)
|
|
Private
.
◆
RestartApplication()
void RestartApplication
|
(
|
const
Utf16Char
*
|
param
=
nullptr
,
|
|
|
Int32
|
exitcode
=
0
,
|
|
|
const
Utf16Char
**
|
path
=
nullptr
|
|
)
|
|
|
Private
.
◆
SetExitCode()
void SetExitCode
|
(
|
Int32
|
exitCode
|
)
|
|
Sets the exit code returned by
Cinema 4D
when it exits.
-
参数
-
[in]
|
exitCode
|
The exit code.
|
◆
GeUpdateUI()
Forces a redraw of the GUI, for example after a change of the preferences or Linear Workflow settings.
◆
GeGetActiveViewportType()
Returns the type of viewport that is currently active
-
返回
-
The type of active viewport:
VIEWPORTTYPE
◆
GetShortcutCount()
Int32
GetShortcutCount
|
(
|
|
)
|
|
Retrieves the global shortcut count.
-
返回
-
The number of shortcuts.
◆
GetShortcut()
Retrieves the shortcut at
index
.
-
参数
-
-
返回
-
The retrieved shortcut.
◆
AddShortcut()
Adds the shortcut in
bc
to the shortcut list.
-
参数
-
[in]
|
bc
|
The container for the shortcut to add:
SHORTCUT
|
-
返回
-
true
if successful, otherwise
false
.
◆
RemoveShortcut()
Removes the shortcut at
index
.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
LoadShortcutSet()
Loads shortcuts.
-
参数
-
[in]
|
fn
|
The file with the shortcuts to load.
|
[in]
|
add
|
true
to add the shortcuts, instead of replacing.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SaveShortcutSet()
Save shortcuts.
-
参数
-
[in]
|
fn
|
The file to save the shortcuts to.
|
-
返回
-
true
if successful, otherwise
false
.
◆
FindShortcutsFromID()
Finds all shortcuts assigned to a command.
-
参数
-
[in]
|
pluginid
|
The plugin ID to search for.
|
[out]
|
indexarray
|
Filled with the found IDs. The caller owns the pointed array.
|
[in]
|
maxarrayelements
|
The size of
indexarray
|
-
返回
-
The number of shortcuts found.
◆
FindShortcuts()
Finds all commands that are assigned to a shortcut.
-
参数
-
[in]
|
scut
|
The shortcut to search for.
|
[in]
|
idarray
|
Filled with the found IDs. The caller owns the pointed array.
|
[in]
|
maxarrayelements
|
The size of
indexarray
.
|
-
返回
-
The number of shortcuts found.
◆
CheckCommandShortcut()
Checks if a shortcut key and qualifier are assigned to a command.
-
参数
-
[in]
|
id
|
The plugin ID of the command.
|
[in]
|
key
|
The shortcut key.
|
[in]
|
qual
|
The qualifier key.
|
-
返回
-
true
if the shortcut/qualifier is assigned, otherwise
false
.
◆
InsertCreateObject()
Adds
op
into document
doc
.
This function takes care for modifiers to add the new object at a certain place in the hierarchy.
For example if shift is pressed while a new object is created it will be inserted below the active object.
-
参数
-
[in]
|
doc
|
The current document.
|
[in]
|
op
|
The object to insert.
|
[in]
|
activeobj
|
The active object, or
nullptr
if no object is active.
|
◆
CopyToClipboard()
[1/2]
Copies a string to the clipboard.
-
参数
-
[in]
|
text
|
The string to copy.
|
◆
CopyToClipboard()
[2/2]
Copies a bitmap to the clipboard.
-
参数
-
[in]
|
map
|
The bitmap to copy. The caller owns the pointed bitmap.
|
[in]
|
ownerid
|
The owner ID:
CLIPBOARDOWNER
|
◆
GetStringFromClipboard()
Retrieves a string from the clipboard.
-
参数
-
[out]
|
txt
|
true
if a string could be retrieved from the clipboard, otherwise
false
.
|
◆
GetBitmapFromClipboard()
Retrieves a bitmap from the clipboard.
-
参数
-
[out]
|
map
|
The bitmap to get. The caller owns the pointed bitmap.
|
-
返回
-
true
if a bitmap could be retrieved from the clipboard, otherwise
false
.
◆
GetClipboardType()
Retrieves the type of the clipboard.
-
返回
-
The type of the clipboard:
CLIPBOARDTYPE
◆
GetC4DClipboardOwner()
Int32
GetC4DClipboardOwner
|
(
|
void
|
|
)
|
|
Retrieves the owner ID of the clipboard.
-
返回
-
The owner ID:
CLIPBOARDOWNER
◆
BrowserLibraryPopup()
Opens a browser popup window (e.g. the Sky object's preset popup).
-
参数
-
[in]
|
mx
|
The X coordinate of the window.
|
[in]
|
my
|
The Y coordinate of the window.
|
[in]
|
defw
|
The width of the window.
|
[in]
|
defh
|
The height of the window.
|
[in]
|
pluginwindowid
|
A unique plugin window ID.
|
[in]
|
presettypeid
|
The preset plugin type ID or a type matching
SDKBrowserPluginInterfaceInfo::GetPluginID()
.
|
[in]
|
userdata
|
The user data. The caller owns the pointed data.
|
[in]
|
callback
|
The popup callback.
|
◆
GetCursorBitmap()
Private
.
◆
CodeEditor_Open()
打开
Cinema 4D
code editor.
-
参数
-
[in]
|
obj
|
The object that the source belongs to. The caller owns the pointed object.
|
[in]
|
callback
|
A callback to set and retrieve the edited source code. The caller owns the pointed callback.
|
[in]
|
bc
|
The settings for the editor that will be opened:
CODEEDITOR
|
-
返回
-
true
if the editor was opened, otherwise
false
.
◆
MinimalViewportSettingsCommand()
void MinimalViewportSettingsCommand
|
(
|
Int32
|
type
|
)
|
|
Private
.
◆
IsAnimationRunning()
Checks if an animation is currently running.
-
参数
-
[in]
|
document
|
The currently active document.
|
-
返回
-
True, if an animation is currently running.
◆
IsUVToolMode()
Check if the current context is UV, if UV mode is selected or the UV Texture Editor is the last one used.
-
参数
-
[in]
|
document
|
The currently active document.
|
-
返回
-
True if is UV mode, false otherwise.
Variable Documentation
◆
CURRENT
Get
机器
features for the currently active OpenGL type.
◆
HARDWARE_OGL
Get
机器
features for Hardware OpenGL.
◆
MAXON_ENUM_LIST
#define COREMSG_CINEMA_EXECUTEEDITORCOMMAND
The result is given as a true or false integer value in the returned GeData.
定义:
c4d_gui.h:81
#define COREMSG_CINEMA
Requests to Cinema 4D core.
定义:
c4d_general.h:1497
AtomArray * result
定义:
operatingsystem.h:828
String GeGetDefaultFilename(Int32 id)
Bool SendModelingCommand(Int32 command, ModelingCommandData &data)
#define COREMSG_CINEMA_EXECUTEOPTIONMODE
Pass whether to open (true) the options dialog or not (false) for COREMSG_CINEMA_EXECUTEEDITORCOMMAND...
定义:
c4d_gui.h:84
void SetInt32(Int32 id, Int32 l)
定义:
c4d_basecontainer.h:505
Bool RegisterMaterialPlugin(Int32 id, const maxon::String &str, Int32 info, DataAllocator *g, const maxon::String &description, Int32 disklevel)
#define COREMSG_CINEMA_GETMACHINEFEATURES
定义:
c4d_general.h:1532
#define COREMSG_CINEMA_GETCOMMANDENABLED
The name is given as a String in the returned GeData.
定义:
c4d_gui.h:77
A helper object for SendModelingCommand().
定义:
operatingsystem.h:805
Int32 GetInt32(void) const
定义:
c4d_gedata.h:427
#define COREMSG_CINEMA_EXECUTESUBID
Pass the sub-ID for COREMSG_CINEMA_EXECUTEEDITORCOMMAND.
定义:
c4d_gui.h:83
GeData SendCoreMessage(Int32 coreid, const BaseContainer &msg, Int32 eventid=0)
BaseObject * op
The input object. Use arr for multiple objects.
定义:
operatingsystem.h:819
void SetFloat(Int32 id, Float r)
定义:
c4d_basecontainer.h:533
#define MCOMMAND_CURRENTSTATETOOBJECT
Current state to object (returns object): MDATA_CURRENTSTATETOOBJECT.
定义:
ge_prepass.h:1410
maxon::Bool Bool
定义:
ge_sys_math.h:53
BaseDocument * doc
定义:
operatingsystem.h:817
#define DEFAULTFILENAME_SHADER_VOLUME
Volume.
定义:
ge_prepass.h:4559
BaseContainer * GetContainer(void) const
定义:
c4d_gedata.h:487
定义:
c4d_basecontainer.h:46
BaseContainer * bc
The modeling command container. Optional to set extra options.
定义:
operatingsystem.h:820
C4DAtom * GetIndex(Int32 idx) const
定义:
c4d_baselist.h:1634