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"]

0 commit comments

Comments
 (0)