Skip to content

Commit b6c67f1

Browse files
committed
S22 Update
Addition of - scripts/04_3d_concepts/scene_elements/materials_shading/material_set_to_selected_poly_r13 - plugins/py-tooldata_ui_r15
1 parent 53e4b47 commit b6c67f1

File tree

200 files changed

+1118
-650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+1118
-650
lines changed

plugins/py-custom_icon_r21/py-custom_icon_r21.pyp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ PLUGIN_ID = 1053134
2626

2727
class CustomIconObjectData(c4d.plugins.ObjectData):
2828

29-
3029
def Init(self, node):
3130
"""
3231
Called when Cinema 4D Initialize the ObjectData (used to define, default values)

plugins/py-cv_rss_r15/py-cv_rss_r15.pyp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ class MyDialog(c4d.gui.GeDialog):
164164
"""
165165
Called after CreateLayout being called to define the values in the UI
166166
:return: True if successful, or False to signalize an error.
167+
:rtype: bool
167168
"""
168169
# Retrieves saved values from the world container of this plugin
169170
self.CVRssData = c4d.plugins.GetWorldPluginData(PLUGIN_ID)
@@ -186,6 +187,7 @@ class MyDialog(c4d.gui.GeDialog):
186187
"""
187188
This method is called automatically by Cinema 4D according to the timer set with GeDialog.SetTimer method.
188189
:param msg: The timer message
190+
:type msg: c4d.BaseContainer
189191
"""
190192
# Scroll RSS function
191193
self.UpdateToNextRss()
@@ -221,7 +223,7 @@ class MyDialog(c4d.gui.GeDialog):
221223
"""
222224

223225
# Retrieves the RSS Url and parse its XML
224-
print "Updating... " + self.rss_url
226+
print("Updating... " + self.rss_url)
225227
dom = xml.dom.minidom.parse(urllib.urlopen(self.rss_url))
226228

227229
# Resets the rss_items list - otherwise the new ones get tacked on the old

plugins/py-double_circle_r19/py-double_circle_r19.pyp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class DoubleCircleHelper(object):
5151
Generates a circle spline of a given radius
5252
:param radius: The radius of the circle to be created.
5353
:type radius: float
54+
:param plane: The axis plane to be used. PRIM_PLANE_XY, PRIM_PLANE_ZY or PRIM_PLANE_XZ
55+
:type plane: int
5456
:return: The generates Circle or None if fail.
5557
:rtype: Union[c4d.SplineObject, None]
5658
"""
@@ -78,7 +80,7 @@ class DoubleCircleHelper(object):
7880
splineObject.SetSegment(id=1, cnt=4, closed=True)
7981

8082
# Loops over each point of a circle
81-
for i in xrange(sub):
83+
for i in range(sub):
8284
sn, cs = c4d.utils.SinCos(2.0 * math.pi * i / float(sub))
8385
# Defines the point position of the outside and inner circle
8486
posOut = c4d.Vector(cs * radius, sn * radius, 0.0)
@@ -340,7 +342,7 @@ class DoubleCircleData(c4d.plugins.ObjectData, DoubleCircleHelper):
340342

341343
# Draw the handle to the correct position
342344
bd.DrawHandle(info.position, c4d.DRAWHANDLE_BIG, 0)
343-
bd.SetPen(c4d.GetViewColor( c4d.VIEWCOLOR_ACTIVEPOINT))
345+
bd.SetPen(c4d.GetViewColor(c4d.VIEWCOLOR_ACTIVEPOINT))
344346
bd.DrawLine(info.position, c4d.Vector(0), 0)
345347

346348
return c4d.DRAWRESULT_OK
@@ -362,7 +364,7 @@ def DoubleCircleHelp(opType, baseType, group, property):
362364
:return:
363365
"""
364366
# Prints the information passed to the plugin help callback
365-
print "Py-DoubleCircle - Help:", opType, baseType, group, property
367+
print("Py-DoubleCircle - Help:", opType, baseType, group, property)
366368

367369
# If the users ask for help in the Radius Parameter
368370
if property == "PYCIRCLEOBJECT_RAD":

plugins/py-dynamic_parameters_object_r18/py-dynamic_parameters_object_r18.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class DynamicParametersObjectData(c4d.plugins.ObjectData):
120120
count = hf.ReadInt32()
121121

122122
# Reads the dynamic parameters value
123-
for idx in xrange(count):
123+
for idx in range(count):
124124
value = hf.ReadFloat32()
125125
self.parameters.append(value)
126126

plugins/py-licensing_example_r21/py-licensing_example_r21.pyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def RegisterPlugin():
188188
"""
189189
Registers your plugin(s) here e.g. RegisterCommandPlugin.
190190
"""
191-
print "Register your plugin here"
191+
print("Register your plugin here")
192192

193193

194194
if __name__ == "__main__":
@@ -213,4 +213,4 @@ if __name__ == "__main__":
213213
# Registers the plugin.
214214
RegisterPlugin()
215215
else:
216-
print "No license found for license_example.pyp"
216+
print("No license found for license_example.pyp")

plugins/py-memory_viewer_r12/py-memory_viewer_r12.pyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class MemoryViewerUserArea(c4d.gui.GeUserArea):
9292
x_step = int((x2 - x1) / self.division + 1)
9393
y_step = int((y2 - y1) / self.division + 1)
9494

95-
for i in xrange(int(self.division)):
95+
for i in range(int(self.division)):
9696
self.DrawLine(x_step * i, y2 - y1, x_step * i, y2 - y2)
9797
self.DrawLine(x1, y2 - (y_step * i), x2, y2 - (y_step * i))
9898

@@ -110,7 +110,7 @@ class MemoryViewerUserArea(c4d.gui.GeUserArea):
110110
l_x1 = int(i * x_step)
111111
l_y1 = int(c4d.utils.RangeMap(v, self.value_min, self.value_max, y1 + offset, y2 - offset, False))
112112
l_x2 = int((i + 1) * x_step)
113-
l_y2 = int( c4d.utils.RangeMap(self.values[i + 1], self.value_min + 10, self.value_max, y1 + offset, y2 - offset,False))
113+
l_y2 = int(c4d.utils.RangeMap(self.values[i + 1], self.value_min + 10, self.value_max, y1 + offset, y2 - offset,False))
114114

115115
# Draws the line
116116
self.DrawLine(l_x1, y2 - l_y1, l_x2, y2 - l_y2)

plugins/py-noise_falloff_r14/py-noise_falloff_r14.pyp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class NoiseFalloffHelper(object):
5454
pos = c4d.Vector() * data.nodemat
5555
pos = [pos.x, pos.y, pos.z]
5656

57-
for i in xrange(3):
57+
for i in range(3):
5858
res = pos[i] + offset[i] + size[i] > point[i] > pos[i] + offset[i] - size[i]
5959
if not res:
6060
break
@@ -79,6 +79,8 @@ class NoiseFalloffHelper(object):
7979
bd.SetPen(c4d.GetViewColor(c4d.VIEWCOLOR_ACTIVEPOINT))
8080

8181
# According the handle id, defines start/end of the line handle
82+
p1, p2, p3, p4 = c4d.Vector(), c4d.Vector(), c4d.Vector(), c4d.Vector()
83+
8284
if i == 0:
8385
p1 = c4d.Vector(0, -size.y, -size.z)
8486
p2 = c4d.Vector(0, -size.y, size.z)

plugins/py-render_token_r21/py-render_token_r21.pyp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def PythonToken(data):
4646
# Returns the frame number as a string. So this will replace the token by the frame number.
4747
return str(data[4])
4848

49+
4950
def PythonHiddenToken(data):
5051
"""
5152
The function that will be called to return the string representation of a token.
@@ -76,7 +77,7 @@ def PythonHiddenToken(data):
7677
return str(data[4])
7778

7879

79-
if __name__=="__main__":
80+
if __name__ == "__main__":
8081
# First it's important to check if the token is not already registered
8182
for registeredToken in c4d.modules.tokensystem.GetAllTokenEntries():
8283
# Checks if the token name is already used, if it's the case exit.

plugins/py-rounded_tube_r13/py-rounded_tube_r13.pyp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,23 @@ class RoundedTubeHelper(object):
108108
# Defines the length according subdivision
109109
uvadr = [0.0] * (srcPtCount + 1)
110110
length = 0.0
111-
for i in xrange(srcPtCount):
111+
for i in range(srcPtCount):
112112
uvadr[i] = length
113113
length += (srcPtList[(i + 1) % srcPtCount] - srcPtList[i]).GetLength()
114114

115115
if length > 0.0:
116116
length = 1.0 / length
117117

118-
for i in xrange(srcPtCount):
118+
for i in range(srcPtCount):
119119
uvadr[i] *= length
120120

121121
uvadr[srcPtCount] = 1.0
122122
polyCount = 0
123-
for i in xrange(srcSub):
123+
for i in range(srcSub):
124124
sn, cs = c4d.utils.SinCos(math.pi * 2 * float(i) / float(srcSub))
125125
v1 = float(i) / float(srcSub)
126126
v2 = float(i+1) / float(srcSub)
127-
for j in xrange(srcPtCount):
127+
for j in range(srcPtCount):
128128
a = srcPtCount * i + j
129129
op.SetPoint(a, c4d.Vector(srcPtList[j].x * cs, srcPtList[j].y, srcPtList[j].x * sn))
130130
if i < srcSub:
@@ -251,15 +251,15 @@ class RoundedTube(c4d.plugins.ObjectData, RoundedTubeHelper):
251251
ptList = [c4d.Vector()] * ptCount
252252

253253
# Defines position for side points
254-
for i in xrange(sub):
254+
for i in range(sub):
255255
ptList[i] = c4d.Vector(rad - iradx, (1.0 - float(i) / sub * 2.0) * (irady - rrad), 0.0)
256256
ptList[i + sub + rsub] = c4d.Vector(rad + (float(i) / sub * 2.0 - 1.0) * (iradx - rrad), -irady, 0.0)
257257
ptList[i + 2 * (sub + rsub)] = c4d.Vector(rad + iradx, (float(i) / float(sub) * 2.0 - 1.0) * (irady - rrad), 0.0)
258258
ptList[i + 3 * (sub + rsub)] = c4d.Vector(rad + (1.0 - float(i) / float(sub) * 2.0) * (iradx - rrad), irady, 0.0)
259259

260260
# Defines position for the top / bottom fillet cap points
261261
pi05 = 1.570796326
262-
for i in xrange(rsub):
262+
for i in range(rsub):
263263
sn, cs = c4d.utils.SinCos(float(i) / rsub * pi05)
264264
ptList[i + sub] = c4d.Vector(rad - (iradx - rrad + cs * rrad), -(irady - rrad + sn * rrad), 0.0)
265265
ptList[i + sub + (sub + rsub)] = c4d.Vector(rad + (iradx - rrad + sn * rrad), -(irady - rrad + cs * rrad), 0.0)
@@ -388,7 +388,7 @@ class RoundedTube(c4d.plugins.ObjectData, RoundedTubeHelper):
388388
hitId = op.GetHighlightHandle(bd)
389389

390390
# Iterates over our handle count and draw them
391-
for i in xrange(self.HANDLECOUNT):
391+
for i in range(self.HANDLECOUNT):
392392
# Defines the color of the handle according of the hovered state of the object.
393393
handleColorFlag = c4d.VIEWCOLOR_HANDLES if c4d.GetC4DVersion() >= 21000 else c4d.VIEWCOLOR_ACTIVEPOINT
394394
hoverColor = c4d.VIEWCOLOR_SELECTION_PREVIEW if hitId == i else handleColorFlag

plugins/py-sculpt_grab_brush_r16/sculpt_grab_brush_r16.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class SculptBrushGrabTool(c4d.plugins.SculptBrushToolData):
109109
mirror = dab.IsMirroredDab()
110110

111111
# Loops over every point on the dab and move them by the moveAmnt.
112-
for pointIdDab in xrange(0, pointCount):
112+
for pointIdDab in range(pointCount):
113113
# Retrieves the index of the point on the PolygonObject.
114114
pointData = dab.GetPointData(pointIdDab)
115115
pointIndex = pointData["pointIndex"]

plugins/py-sculpt_modifier_deformer_r16/sculpt_modifier_deformer_r16.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class SculptModifierDeformer(c4d.plugins.ObjectData):
137137
# Defines the random seed, so random is consistent over time
138138
random.seed(seed)
139139

140-
for i in xrange(0, numStamps):
140+
for i in range(numStamps):
141141
# Retrieves a random a pointIndex
142142
ptId = int(random.random() * op.GetPointCount())
143143

plugins/py-sculpt_paint_brush_r16/sculpt_paint_brush_r16.pyp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class PaintBrushToolHelper(object):
115115
flag = c4d.PIXELCNT_NONE if c4d.GetC4DVersion() > 20000 else c4d.PIXELCNT_0
116116
bmp.GetPixelCnt(startPixel, y, numPixels, sq, c4d.COLORMODE_RGB, flag)
117117

118-
for x in xrange(startPixel, endPixel):
118+
for x in range(startPixel, endPixel):
119119
# Retrieves the location on the object for this part of the triangle that we are rasterizing
120120
pos = span.color1 + (colorDiff * factor)
121121

@@ -188,7 +188,7 @@ class PaintBrushToolHelper(object):
188188
factorStep2 = 1.0 / e2ydiff
189189

190190
# Loops through the lines between the edges and draw spans
191-
for y in xrange(int(e2.y1), int(e2.y2)):
191+
for y in range(int(e2.y1), int(e2.y2)):
192192
# Creates and draw span
193193
span = Span(e1.color1 + (e1pointdiff * factor1), e1.x1 + int(e1xdiff * factor1), e2.color1 + (e2pointdiff * factor2), e2.x1 + int(e2xdiff * factor2))
194194
PaintBrushToolHelper.DrawSpan(dab, bmp, span, y)
@@ -234,7 +234,7 @@ class PaintBrushToolHelper(object):
234234
longEdge = 0
235235

236236
# Finds edge with the greatest length in the y axis
237-
for i in xrange(0, 3):
237+
for i in range(0, 3):
238238
length = edges[i].y2 - edges[i].y1
239239
if length > maxLength:
240240
maxLength = length
@@ -316,7 +316,7 @@ class PaintBrushTool(c4d.plugins.SculptBrushToolData, PaintBrushToolHelper):
316316
maxY = 0
317317

318318
# Loops over very polygon for this dab and rasterize the stencil to it.
319-
for a in xrange(0, polyCount):
319+
for a in range(0, polyCount):
320320
# Retrieves the index of the point on the PolygonObject.
321321
polyData = dab.GetPolyData(a)
322322
polyIndex = polyData["polyIndex"]

plugins/py-sculpt_pull_brush_r16/sculpt_pull_brush_r16.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class SculptBrushPullTool(c4d.plugins.SculptBrushToolData):
9090
multPreMult = -multPreMult
9191

9292
# Loops over every points for this dab and move it if we need to.
93-
for a in xrange(0, pointCount):
93+
for a in range(0, pointCount):
9494
# Retrieves the index of the point on the PolygonObject.
9595
pointData = dab.GetPointData(a)
9696
pointIndex = pointData["pointIndex"]

plugins/py-sculpt_save_mask_r15/sculpt_save_mask_r15.pyp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,11 @@ class MaskImageCmdHelper(object):
9595
return
9696

9797
# Draw each pixels
98-
for x in xrange(int(math.floor(span.x1)), int(math.ceil(span.x2))):
98+
for x in range(int(math.floor(span.x1)), int(math.ceil(span.x2))):
9999
col = span.color1 + (colordiff * factor)
100100
bmp.SetPixel(x, y, int(col.x * 255), int(col.y * 255), int(col.z * 255))
101101
factor += factorStep
102102

103-
104103
@staticmethod
105104
def DrawSpansBetweenEdges(bmp, e1, e2):
106105
"""
@@ -131,7 +130,7 @@ class MaskImageCmdHelper(object):
131130
factorStep2 = 1.0 / e2ydiff
132131

133132
# Loops through the lines between the edges and draw spans
134-
for y in xrange(int(e2.y1), int(e2.y2)):
133+
for y in range(int(e2.y1), int(e2.y2)):
135134
# Creates and draw span
136135
span = Span(e1.color1 + (e1pointdiff * factor1), e1.x1 + int(e1xdiff * factor1), e2.color1 + (e2pointdiff * factor2), e2.x1 + int(e2xdiff * factor2))
137136
MaskImageCmdHelper.DrawSpan(bmp, span, y)
@@ -177,7 +176,7 @@ class MaskImageCmdHelper(object):
177176
longEdge = 0
178177

179178
# Finds edge with the greatest length in the y axis
180-
for i in xrange(0, 3):
179+
for i in range(0, 3):
181180
length = edges[i].y2 - edges[i].y1
182181
if length > maxLength:
183182
maxLength = length
@@ -212,7 +211,7 @@ class MaskImageCmdHelper(object):
212211
imageWidth = bmp.GetBw()
213212
imageHeight = bmp.GetBh()
214213
polyCount = polyObject.GetPolygonCount()
215-
for polyIndex in xrange(polyCount):
214+
for polyIndex in range(polyCount):
216215
status = float(polyIndex) / float(polyCount) * 100.0
217216
c4d.StatusSetBar(status)
218217

plugins/py-sculpt_twist_brush_r16/sculpt_twist_brush_r16.pyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ class SculptBrushTwistTool(c4d.plugins.SculptBrushToolData):
9494
# Loops over very point for this dab and move it if we need to.
9595
pointCount = dab.GetPointCount()
9696
mirrored = dab.IsMirroredDab()
97-
for a in xrange(0,pointCount):
97+
for a in range(0, pointCount):
9898
# Retrieves the index of the point on the PolygonObject.
9999
pointData = dab.GetPointData(a)
100100
pointIndex = pointData["pointIndex"]
101101

102-
#Retrieves the falloff for this point. This will always be a value from 0 to 1.
102+
# Retrieves the falloff for this point. This will always be a value from 0 to 1.
103103
# The value returned is a combination of the following values all multiplied together to give a final value.
104104
# - The falloff curve.
105105
# - The color of the stamp with its color value averaged to gray and adjusted by the Gray Value.

plugins/py-spherify_modifier_r13/py-spherify_modifier_r13.pyp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ class SpherifyModifier(c4d.plugins.ObjectData):
103103
self.falloffDirty = dirty
104104
op.SetDirty(c4d.DIRTYFLAGS_DATA)
105105

106-
107106
def GetDDescription(self, node, description, flags):
108107
"""
109108
Called by Cinema 4D when the description (UI) is queried.
@@ -399,7 +398,7 @@ class SpherifyModifier(c4d.plugins.ObjectData):
399398
# Checks if one of the handle of the current object is currently hovered by the mouse.
400399
hitId = op.GetHighlightHandle(bd)
401400

402-
for i in xrange(SpherifyModifier.HANDLECOUNT):
401+
for i in range(SpherifyModifier.HANDLECOUNT):
403402
# Defines the color of the handle according of the hovered state of the object.
404403
hoverColor = c4d.VIEWCOLOR_ACTIVEPOINT if hitId != i else c4d.VIEWCOLOR_SELECTION_PREVIEW
405404
bd.SetPen(c4d.GetViewColor(hoverColor))

plugins/py-texture_baker_r18/py-texture_baker_r18.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class TextureBakerHelper(object):
150150
# Initializes the thread
151151
if not self.textureBakerThread.Begin():
152152
# In case of errors, notifies the user
153-
print "Bake Init Failed: Error " + str(self.textureBakerThread.bakeError)
153+
print("Bake Init Failed: Error " + str(self.textureBakerThread.bakeError))
154154
self.SetString(self.infoText, str("Bake Init Failed: Error " + str(self.textureBakerThread.bakeError)))
155155

156156
# Sets Button enable states so cancel button can be pressed

0 commit comments

Comments
 (0)