Skip to content

Commit aea195b

Browse files
committed
R25 Release
Add nodes example within scripts\05_modules\node Update symbols to remove deprecated one
1 parent a73d4ba commit aea195b

File tree

22 files changed

+696
-24
lines changed

22 files changed

+696
-24
lines changed

plugins/py-liquid_painter_r12/py-liquid_painter_r12.pyp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ class LiquidTool(c4d.plugins.ToolData):
128128
raise MemoryError("Failed to create a Phong Tag.")
129129

130130
# Adds an undo step
131-
doc.AddUndo(c4d.UNDO_NEW, metaball)
131+
doc.AddUndo(c4d.UNDOTYPE_NEWOBJ, metaball)
132132

133133
# Inserts the object in the active document and set it as active one.
134134
doc.InsertObject(metaball)
135135
doc.SetActiveObject(metaball)
136136

137137
# Updates the Viewport (so the metaball is drawn)
138-
c4d.DrawViews(c4d.DA_ONLY_ACTIVE_VIEW | c4d.DA_NO_THREAD | c4d.DA_NO_ANIMATION)
138+
c4d.DrawViews(c4d.DRAWFLAGS_ONLY_ACTIVE_VIEW | c4d.DRAWFLAGS_NO_THREAD | c4d.DRAWFLAGS_NO_ANIMATION)
139139

140140
# Retrieves the X/Y screen position of the mouse.
141141
mx = msg[c4d.BFM_INPUT_X]
@@ -171,7 +171,7 @@ class LiquidTool(c4d.plugins.ToolData):
171171
sphere.InsertUnder(metaball)
172172

173173
# Updates the Viewport (so the metaball with the newly created sphere is drawn)
174-
c4d.DrawViews(c4d.DA_ONLY_ACTIVE_VIEW | c4d.DA_NO_THREAD | c4d.DA_NO_ANIMATION)
174+
c4d.DrawViews(c4d.DRAWFLAGS_ONLY_ACTIVE_VIEW | c4d.DRAWFLAGS_NO_THREAD | c4d.DRAWFLAGS_NO_ANIMATION)
175175

176176
# Updates drag information
177177
result, dx, dy, channel = win.MouseDrag()

plugins/py-rounded_tube_r13/py-rounded_tube_r13.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class RoundedTube(c4d.plugins.ObjectData, RoundedTubeHelper):
227227
"""
228228
# Disable the following lines because cache flag was set
229229
# So the cache build is done before this method is called
230-
# dirty = op.CheckCache(hierarchyhelp) or op.IsDirty(c4d.DIRTY_DATA)
230+
# dirty = op.CheckCache(hierarchyhelp) or op.IsDirty(c4d.DIRTYFLAGS_DATA)
231231
# if dirty is False: return op.GetCache(hierarchyhelp)
232232

233233
# Retrieves parameters value from the generator object

plugins/py-spherify_modifier_r13/py-spherify_modifier_r13.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class SpherifyModifier(c4d.plugins.ObjectData):
341341

342342
if self.falloff is not None and not skipFalloff:
343343
if not self.falloff.InitFalloff(op.GetDataInstance(), bh.GetDocument(), op):
344-
return c4d.DRAWRESULT_ERROR
344+
return c4d.DRAWRESULT_FAILURE
345345

346346
# Retrieves the object color
347347
bd.SetPen(bd.GetObjectColor(bh, op))

plugins/py-texture_baker_r18/py-texture_baker_r18.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class TextureBakerThread(c4d.threading.C4DThread):
8282
return False
8383

8484
# Starts bake thread
85-
self.Start(c4d.THREADMODE_ASYNC, c4d.THREADPRIORITY_BELOW)
85+
self.Start(c4d.THREADMODE_ASYNC, c4d.THREADPRIORITEXY_BELOW)
8686

8787
return True
8888

plugins/py-tooldata_ui_r15/py-tooldata_ui_r15.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class ToolDataWithUiExample(c4d.plugins.ToolData):
250250
doc.StartUndo()
251251

252252
# Adds an undo step
253-
doc.AddUndo(c4d.UNDO_NEW, cloned)
253+
doc.AddUndo(c4d.UNDOTYPE_NEWOBJ, cloned)
254254

255255
# Inserts the cloned object in the active document.
256256
doc.InsertObject(cloned)

scripts/03_application_development/gui/description/description_check_descid_r18.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def main():
2323
raise RuntimeError("Failed to retrieve the description.")
2424

2525
# Builds the object's X position parameter DescID
26-
descId = c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_POSITION, 0, 0), c4d.DescLevel(c4d.VECTOR_X, 0, 0))
26+
descId = c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_REL_POSITION, 0, 0), c4d.DescLevel(c4d.VECTOR_X, 0, 0))
2727

2828
# Prints previously built DescID
2929
print(descId)

scripts/04_3d_concepts/modeling/read_write_normal_tag_r13.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
QUARTER_PI = math.pi * .25
2525

26+
2627
def ReadNormalTag(tag):
2728
"""Reads a c4d.NormalTag to a list of c4d.Vector.
2829
@@ -59,6 +60,7 @@ def ReadNormalTag(tag):
5960
data[i-1] * factor)
6061
for i in range(3, len(data) + 3, 3)]
6162

63+
6264
def WriteNormalTag(tag, normals, doNormalize=True):
6365
"""Writes a list of c4d.Vector to a c4d.NormalTag.
6466
@@ -106,6 +108,7 @@ def WriteNormalTag(tag, normals, doNormalize=True):
106108
data = data.tobytes()
107109
buffer[:len(data)] = data
108110

111+
109112
def main():
110113
"""Entry point."""
111114
# Raise an error when the primary selection is not a PolygonObject.
@@ -128,7 +131,7 @@ def main():
128131

129132
# Get the normals from the newly allocated NormalTag.
130133
normals = ReadNormalTag(normalTag)
131-
print (f"Normals of the newly allocated tag: {normals}")
134+
print(f"Normals of the newly allocated tag: {normals}")
132135

133136
# This should not happen.
134137
if len(phongNormals) != len(normals):
@@ -139,20 +142,21 @@ def main():
139142

140143
# Inspect our write operation in the console.
141144
normals = ReadNormalTag(normalTag)
142-
print (f"Normals after writing the phong normals: {normals}")
145+
print(f"Normals after writing the phong normals: {normals}")
143146

144147
# Start an undo block.
145148
doc.StartUndo()
146149
# Insert our NormalTag.
147150
op.InsertTag(normalTag)
148151
# For insertions the undo has to be added after the operation.
149-
doc.AddUndo(c4d.UNDOTYPE_NEW, normalTag)
152+
doc.AddUndo(c4d.UNDOTYPE_NEWOBJ, normalTag)
150153
# End the undo block.
151154
doc.EndUndo()
152155

153156
# Notify Cinema and the object that we did made changes.
154157
op.Message(c4d.MSG_UPDATE)
155158
c4d.EventAdd()
156159

160+
157161
if __name__ == "__main__":
158162
main()

scripts/04_3d_concepts/scene_elements/animation/ctrack_copy_r14.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def main():
3838

3939
# Defines a list that will contains the ID of parameters we want to copy.
4040
# Such ID can be found by drag-and-drop a parameter into the python console.
41-
trackListToCopy = [c4d.ID_BASEOBJECT_POSITION, c4d.ID_BASEOBJECT_ROTATION, c4d.ID_BASEOBJECT_SCALE]
41+
trackListToCopy = [c4d.ID_BASEOBJECT_REL_POSITION, c4d.ID_BASEOBJECT_REL_ROTATION, c4d.ID_BASEOBJECT_REL_SCALE]
4242

4343
# Start the Undo process.
4444
doc.StartUndo()
@@ -56,15 +56,15 @@ def main():
5656
foundTrack = fixedBox.FindCTrack(did)
5757
if foundTrack:
5858
# Removes the track if found.
59-
doc.AddUndo(c4d.UNDOTYPE_DELETE, foundTrack)
59+
doc.AddUndo(c4d.UNDOTYPE_DELETEOBJ, foundTrack)
6060
foundTrack.Remove()
6161

6262
# Copies the initial CTrack in memory. All CCurve and CKey are kept in this CTrack.
6363
clone = track.GetClone()
6464

6565
# Inserts the copied CTrack to the static object.
6666
fixedBox.InsertTrackSorted(clone)
67-
doc.AddUndo(c4d.UNDOTYPE_NEW, clone)
67+
doc.AddUndo(c4d.UNDOTYPE_NEWOBJ, clone)
6868

6969
# Ends the Undo Process.
7070
doc.EndUndo()

scripts/04_3d_concepts/scene_elements/animation/ctrack_create_keys_r13.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def main():
6262
obj = c4d.BaseObject(c4d.Ocube)
6363

6464
# Creates the track in memory. Defined by it's DescID
65-
trackY = c4d.CTrack(obj, c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_POSITION, c4d.DTYPE_VECTOR, 0),
65+
trackY = c4d.CTrack(obj, c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_REL_POSITION, c4d.DTYPE_VECTOR, 0),
6666
c4d.DescLevel(c4d.VECTOR_Y, c4d.DTYPE_REAL, 0)))
6767

6868
# Gets curves for the track

scripts/04_3d_concepts/scene_elements/materials_shading/material_set_to_selected_poly_r13.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def AssignMatToObject(obj, matList, onlyToSelection=False):
3131
for mat in matList:
3232
# Creates the texture Tag
3333
textureTag = obj.MakeTag(c4d.Ttexture)
34-
doc.AddUndo(c4d.UNDOTYPE_NEW, textureTag)
34+
doc.AddUndo(c4d.UNDOTYPE_NEWOBJ, textureTag)
3535

3636
# If the texture tag is not available at this point, something went wrong
3737
if textureTag is None:
@@ -63,7 +63,7 @@ def AssignMatToObject(obj, matList, onlyToSelection=False):
6363

6464
# Creates the selection tag
6565
selectionTag = obj.MakeTag(c4d.Tpolygonselection)
66-
doc.AddUndo(c4d.UNDOTYPE_NEW, selectionTag)
66+
doc.AddUndo(c4d.UNDOTYPE_NEWOBJ, selectionTag)
6767

6868
# Checks if there was no error during the creation of the selection tag
6969
if selectionTag is None:

0 commit comments

Comments
 (0)