Skip to content

Commit 7692ecd

Browse files
committed
Python SDK Examples for Cinema 4D 2025.0.0
1 parent a2bf564 commit 7692ecd

35 files changed

+486
-99
lines changed

plugins/py-double_circle_r19/py-double_circle_r19.pyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,15 @@ class DoubleCircleData(c4d.plugins.ObjectData, DoubleCircleHelper):
332332

333333
# Defines the color of the handle according of the hovered state of the object.
334334
hoverColor = c4d.VIEWCOLOR_ACTIVEPOINT if hitId != 0 else c4d.VIEWCOLOR_SELECTION_PREVIEW
335-
bd.SetPen(c4d.GetViewColor(hoverColor))
335+
bd.SetPen(c4d.GetViewColor(hoverColor), 0)
336336

337337
# Retrieves the information of the current handle.
338338
info = c4d.HandleInfo()
339339
self.GetHandle(op, 0, info)
340340

341341
# Draw the handle to the correct position
342342
bd.DrawHandle(info.position, c4d.DRAWHANDLE_BIG, 0)
343-
bd.SetPen(c4d.GetViewColor(c4d.VIEWCOLOR_ACTIVEPOINT))
343+
bd.SetPen(c4d.GetViewColor(c4d.VIEWCOLOR_ACTIVEPOINT), 0)
344344
bd.DrawLine(info.position, c4d.Vector(0), 0)
345345

346346
return c4d.DRAWRESULT_OK

plugins/py-noise_falloff_r14/py-noise_falloff_r14.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class NoiseFalloffHelper(object):
7070
"""
7171

7272
# Defines the Draw Color
73-
bd.SetPen(c4d.GetViewColor(c4d.VIEWCOLOR_ACTIVEPOINT))
73+
bd.SetPen(c4d.GetViewColor(c4d.VIEWCOLOR_ACTIVEPOINT), 0)
7474

7575
# According the handle id, defines start/end of the line handle
7676
p1, p2, p3, p4 = c4d.Vector(), c4d.Vector(), c4d.Vector(), c4d.Vector()

plugins/py-ocio_node_2025/py-ocio_node_2025.pyp

Lines changed: 340 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef C4D_SYMBOLS_H__
2+
#define C4D_SYMBOLS_H__
3+
4+
enum
5+
{
6+
// Plugin IDs
7+
PID_OCIO_NODE_2025 = 1064267,
8+
9+
// String IDs
10+
IDS_NME_OCIO_NODE_2025 = 10000,
11+
12+
// End of symbol definition
13+
_DUMMY_ELEMENT_
14+
};
15+
16+
#endif //C4D_SYMBOLS_H__
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef OOCIONODE2025_H__
2+
#define OOCIONODE2025_H__
3+
4+
enum
5+
{
6+
OCIO_NODE_2025_COLOR = 1000,
7+
};
8+
9+
#endif // OOCIONODE2025_H__
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CONTAINER Oocionode2025
2+
{
3+
NAME Oocionode2025;
4+
INCLUDE Obase;
5+
6+
GROUP ID_OBJECTPROPERTIES
7+
{
8+
COLOR OCIO_NODE_2025_COLOR {}
9+
}
10+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
STRINGTABLE
2+
{
3+
IDS_NME_OCIO_NODE_2025 "Python SDK: Ocio Node 2025";
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
STRINGTABLE Oocionode2025
2+
{
3+
Oocionode2025 "Ocio Node 2025";
4+
OCIO_NODE_2025_COLOR "Color";
5+
}

plugins/py-rounded_tube_r13/py-rounded_tube_r13.pyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ class RoundedTube(c4d.plugins.ObjectData, RoundedTubeHelper):
388388
# Defines the color of the handle according of the hovered state of the object.
389389
handleColorFlag = c4d.VIEWCOLOR_HANDLES if c4d.GetC4DVersion() >= 21000 else c4d.VIEWCOLOR_ACTIVEPOINT
390390
hoverColor = c4d.VIEWCOLOR_SELECTION_PREVIEW if hitId == i else handleColorFlag
391-
bd.SetPen(c4d.GetViewColor(hoverColor))
391+
bd.SetPen(c4d.GetViewColor(hoverColor), 0)
392392

393393
# Retrieves the information of the current handle.
394394
info = c4d.HandleInfo()
@@ -398,7 +398,7 @@ class RoundedTube(c4d.plugins.ObjectData, RoundedTubeHelper):
398398
bd.DrawHandle(info.position, c4d.DRAWHANDLE_BIG, 0)
399399

400400
# Sets the color back to normal before drawing lines
401-
bd.SetPen(c4d.GetViewColor(handleColorFlag))
401+
bd.SetPen(c4d.GetViewColor(handleColorFlag), 0)
402402

403403
# Draws the lines 0, 1, 2 are draw in the same drawcall
404404
if i == 0:

plugins/py-spherify_modifier_r13/py-spherify_modifier_r13.pyp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ class SpherifyModifier(c4d.plugins.ObjectData):
346346
return c4d.DRAWRESULT_FAILURE
347347

348348
# Retrieves the object color
349-
bd.SetPen(bd.GetObjectColor(bh, op))
349+
bd.SetPen(bd.GetObjectColor(bh, op), c4d.SET_PEN_USE_PROFILE_COLOR)
350350
bd.SetMatrix_Matrix(None, c4d.Matrix())
351351

352352
# Defines the scale/rotation where drawing will operate by the radius of the generator
@@ -389,7 +389,7 @@ class SpherifyModifier(c4d.plugins.ObjectData):
389389
for i in range(SpherifyModifier.HANDLECOUNT):
390390
# Defines the color of the handle according of the hovered state of the object.
391391
hoverColor = c4d.VIEWCOLOR_ACTIVEPOINT if hitId != i else c4d.VIEWCOLOR_SELECTION_PREVIEW
392-
bd.SetPen(c4d.GetViewColor(hoverColor))
392+
bd.SetPen(c4d.GetViewColor(hoverColor), 0)
393393

394394
# Retrieves the information of the current handle.
395395
info = c4d.HandleInfo()
@@ -399,7 +399,7 @@ class SpherifyModifier(c4d.plugins.ObjectData):
399399
bd.DrawHandle(info.position, c4d.DRAWHANDLE_BIG, 0)
400400

401401
# Draw the line to the second Handle
402-
bd.SetPen(c4d.GetViewColor(c4d.VIEWCOLOR_ACTIVEPOINT))
402+
bd.SetPen(c4d.GetViewColor(c4d.VIEWCOLOR_ACTIVEPOINT), 0)
403403
bd.DrawLine(info.position, c4d.Vector(0), 0)
404404

405405
# If the current draw pass is not the object or handle, skip this Draw Call.

0 commit comments

Comments
 (0)