Skip to content

Commit 762c9d5

Browse files
committed
R23 Update
R23 brings Python 3.7.7 to Cinema 4D
1 parent ec3b5dd commit 762c9d5

File tree

198 files changed

+524
-431
lines changed

Some content is hidden

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

198 files changed

+524
-431
lines changed

plugins/py-cv_rss_r15/py-cv_rss_r15.pyp renamed to plugins/py-cv_rss_r23/py-cv_rss_r23.pyp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Class/method highlighted:
2020
2121
Compatible:
2222
- Win / Mac
23-
- R15, R16, R17, R18, R19, R20, R21
23+
- R23
2424
"""
2525
import c4d
2626
import os
27-
import urllib
27+
import urllib.request
2828
import webbrowser
29-
import xml
29+
import xml.dom.minidom
3030

3131
# Be sure to use a unique ID obtained from www.plugincafe.com
3232
PLUGIN_ID = 1025244
@@ -224,7 +224,7 @@ class MyDialog(c4d.gui.GeDialog):
224224

225225
# Retrieves the RSS Url and parse its XML
226226
print("Updating... " + self.rss_url)
227-
dom = xml.dom.minidom.parse(urllib.urlopen(self.rss_url))
227+
dom = xml.dom.minidom.parse(urllib.request.urlopen(self.rss_url))
228228

229229
# Resets the rss_items list - otherwise the new ones get tacked on the old
230230
self.rss_items = []

plugins/py-double_circle_r19/py-double_circle_r19.pyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class DoubleCircleData(c4d.plugins.ObjectData, DoubleCircleHelper):
306306

307307
val = p * info.direction
308308

309-
data.SetFloat(c4d.PYCIRCLEOBJECT_RAD, c4d.utils.FCut(val, 0.0, sys.maxint))
309+
data.SetFloat(c4d.PYCIRCLEOBJECT_RAD, c4d.utils.FCut(val, 0.0, sys.maxsize))
310310

311311
def Draw(self, op, drawpass, bd, bh):
312312
"""

plugins/py-licensing_example_r21/py-licensing_example_r21.pyp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ class LicenceHelper(object):
105105

106106
# Reads the content
107107
licFileContent = None
108-
with open(self.storedLicensePath, "r") as licFile:
109-
licFileContent = licFile.read().decode("utf-8")
108+
with open(self.storedLicensePath, "r", encoding="utf-8") as licFile:
109+
licFileContent = licFile.read()
110110

111111
# Checks the license
112112
return self.IsValidSerial(licFileContent)
@@ -160,7 +160,7 @@ class LicensingExampleDialog(c4d.gui.GeDialog, LicenceHelper):
160160
# User enter something in the input text
161161
if messageId == self.ID_EDIT_TEXT:
162162
# Retrieves teh text from the input string field and converts it to utf-8
163-
enteredString = self.GetString(self.ID_EDIT_TEXT).decode("utf-8")
163+
enteredString = self.GetString(self.ID_EDIT_TEXT)
164164

165165
# Checks if the entered string is a correct serial
166166
if self.IsValidSerial(enteredString):

plugins/py-rounded_tube_r13/py-rounded_tube_r13.pyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,11 @@ class RoundedTube(c4d.plugins.ObjectData, RoundedTubeHelper):
350350

351351
# According the current HandleID
352352
if i is 0:
353-
op[c4d.PY_TUBEOBJECT_RAD] = c4d.utils.FCut(op[c4d.PY_TUBEOBJECT_RAD]+val, op[c4d.PY_TUBEOBJECT_IRADX], sys.maxint)
353+
op[c4d.PY_TUBEOBJECT_RAD] = c4d.utils.FCut(op[c4d.PY_TUBEOBJECT_RAD]+val, op[c4d.PY_TUBEOBJECT_IRADX], sys.maxsize)
354354
elif i is 1:
355355
op[c4d.PY_TUBEOBJECT_IRADX] = c4d.utils.FCut(op[c4d.PY_TUBEOBJECT_IRADX]+val, op[c4d.PY_TUBEOBJECT_ROUNDRAD], op[c4d.PY_TUBEOBJECT_RAD])
356356
elif i is 2:
357-
op[c4d.PY_TUBEOBJECT_IRADY] = c4d.utils.FCut(op[c4d.PY_TUBEOBJECT_IRADY]+val, op[c4d.PY_TUBEOBJECT_ROUNDRAD], sys.maxint)
357+
op[c4d.PY_TUBEOBJECT_IRADY] = c4d.utils.FCut(op[c4d.PY_TUBEOBJECT_IRADY]+val, op[c4d.PY_TUBEOBJECT_ROUNDRAD], sys.maxsize)
358358
elif i is 3 or i is 4:
359359
op[c4d.PY_TUBEOBJECT_ROUNDRAD] = c4d.utils.FCut(op[c4d.PY_TUBEOBJECT_ROUNDRAD]+val, 0.0, min(op[c4d.PY_TUBEOBJECT_IRADX], op[c4d.PY_TUBEOBJECT_IRADY]))
360360

plugins/py-tooldata_ui_r15/py-tooldata_ui_r15.pyp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ class ToolDataWithUiExample(c4d.plugins.ToolData):
267267
doc.InsertObject(cloned)
268268

269269
# Creates some random position
270-
x = random.randrange(-1000.0, 1000.0, 0.1, float)
271-
y = random.randrange(-1000.0, 1000.0, 0.1, float)
272-
z = random.randrange(-1000.0, 1000.0, 0.1, float)
270+
x = round(random.uniform(-1000.0, 1000.0), 3)
271+
y = round(random.uniform(-1000.0, 1000.0), 3)
272+
z = round(random.uniform(-1000.0, 1000.0), 3)
273273

274274
# Sets the position of the object
275275
newPos = c4d.Vector(x, y, z)

plugins/py-xample_loader_r15/py-xample_loader_r15.pyp renamed to plugins/py-xample_loader_r23/py-xample_loader_r23.pyp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Class/method highlighted:
1919
2020
Compatible:
2121
- Win / Mac
22-
- R13, R14, R15, R16, R17, R18, R19, R20, R21
22+
- R23
2323
"""
2424
import c4d
2525
import struct
@@ -29,8 +29,8 @@ import bz2
2929
# Be sure to use a unique ID obtained from www.plugincafe.com
3030
PLUGIN_ID = 1025255
3131

32-
BMP_NAME = "Py-XAMPLE"
33-
BMP_IDENTIFIER = "XAMPLE"
32+
BMP_NAME = "Py-XAMPLE Loader"
33+
BMP_IDENTIFIER = b"XAMPLE"
3434

3535

3636
class MyXampleLoader(c4d.plugins.BitmapLoaderData):
@@ -68,7 +68,7 @@ class MyXampleLoader(c4d.plugins.BitmapLoaderData):
6868

6969
# Calculates the bits size of 3 int and 3 char
7070
intBitsSize = struct.calcsize("iii")
71-
chatBitsSize = struct.calcsize("ccc")
71+
chatBitsSize = struct.calcsize("hhh")
7272

7373
# Extracts bit depth, width and height information
7474
bt, width, height = struct.unpack("iii", lines[:intBitsSize])
@@ -91,10 +91,10 @@ class MyXampleLoader(c4d.plugins.BitmapLoaderData):
9191
fr = (y * width * chatBitsSize) + (x * chatBitsSize)
9292

9393
# Extracts red, green, blue information
94-
r, g, b = struct.unpack("ccc", lines[fr:fr+chatBitsSize])
94+
r, g, b = struct.unpack("hhh", lines[fr:fr+chatBitsSize])
9595

9696
# Assigns pixel value for x, y pixel
97-
bm[x, y] = ord(r), ord(g), ord(b)
97+
bm[x, y] = r, g, b
9898

9999
return c4d.IMAGERESULT_OK
100100

plugins/py-xample_saver_r13/py-xample_saver_r13.pyp renamed to plugins/py-xample_saver_r23/py-xample_saver_r23.pyp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Class/method highlighted:
1919
2020
Compatible:
2121
- Win / Mac
22-
- R15, R16, R17, R18, R19, R20, R21
22+
- R23
2323
"""
2424
import c4d
2525
import struct
@@ -29,8 +29,8 @@ import bz2
2929
# Be sure to use a unique ID obtained from www.plugincafe.com
3030
PLUGIN_ID = 1025254
3131

32-
BMP_NAME = "Py-XAMPLE"
33-
BMP_IDENTIFIER = "XAMPLE"
32+
BMP_NAME = "Py-XAMPLE Saver"
33+
BMP_IDENTIFIER = b"XAMPLE"
3434
BMP_SUFFIX = "xample"
3535

3636

@@ -60,8 +60,8 @@ class MyXampleSaver(c4d.plugins.BitmapSaverData):
6060
# Try to convert the entered value in integer otherwise ask again.
6161
try:
6262
result = int(result)
63-
except ValueError, e:
64-
c4d.gui.MessageDialog(e, c4d.GEMB_OK)
63+
except ValueError as e:
64+
c4d.gui.MessageDialog(str(e), c4d.GEMB_OK)
6565
continue
6666

6767
# Checks if entered value is between 1, and 9, otherwise ask again.
@@ -96,7 +96,7 @@ class MyXampleSaver(c4d.plugins.BitmapSaverData):
9696
fn.write(p)
9797

9898
# Retrieves bitmap data, in python 2.7 str and bits are the same, so we are storing raw bits here
99-
content = ""
99+
content = b""
100100
# Iterates each lines to fill the BaseBitmap
101101
for y in range(bm.GetBh()):
102102
# Iterates each rows to fill the BaseBitmap
@@ -106,8 +106,8 @@ class MyXampleSaver(c4d.plugins.BitmapSaverData):
106106
r, g, b = bm[x, y]
107107

108108
# Stores pixel information as bits
109-
content += struct.pack("ccc", chr(r), chr(g), chr(b))
110-
109+
content += struct.pack("hhh", r, g, b)
110+
111111
# Compress pixels information
112112
compression = data.GetInt32(self.COMPRESSION, self.STANDARD_COMP)
113113

@@ -121,6 +121,8 @@ if __name__ == "__main__":
121121
# Registers the bitmap saver plugin
122122
c4d.plugins.RegisterBitmapSaverPlugin(id=PLUGIN_ID,
123123
str=BMP_NAME,
124-
info=c4d.PLUGINFLAG_BITMAPSAVER_ALLOWOPTIONS | c4d.PLUGINFLAG_BITMAPSAVER_SUPPORT_8BIT| c4d.PLUGINFLAG_BITMAPSAVER_FORCESUFFIX,
124+
info=c4d.PLUGINFLAG_BITMAPSAVER_ALLOWOPTIONS |
125+
c4d.PLUGINFLAG_BITMAPSAVER_SUPPORT_8BIT |
126+
c4d.PLUGINFLAG_BITMAPSAVER_FORCESUFFIX,
125127
dat=MyXampleSaver(),
126128
suffix=BMP_SUFFIX)

plugins/readme.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ This folder contains plugins that should be copied in the plugins folder of Cine
99
A data class for creating command plugins. (Previously known as menu plugins.)
1010

1111
### py-cv_rss
12-
Version: R15, R16, R17, R18, R19, R20, R21 - Win/Mac
12+
Version: R23 - Win/Mac
1313

1414
Creates a Dialog which display the latest RSS feed of Cineversity.
1515
Opens the web browser of the current displayed news when the user click a button.
1616

1717
### py-memory_viewer
18-
Version: R12, R13, R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
18+
Version: R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
1919

2020
Creates a Dialog which display the memory usage.
2121
The Memory Usage is displayed in a custom Gadget (GeUserArea).
2222

2323
### py-texture_baker
24-
Version: R18, R19, R20, R21 - Win/Mac
24+
Version: R18, R19, R20, R21, S22, R23 - Win/Mac
2525

2626
Creates a Dialog to manage texture baking.
2727
Bakes selected object diffuse to the uv and display the result in the Picture Viewer.
2828

2929
### py-sculpt_save_mask
30-
Version: R15, R16, R17, R18, R19, R20, R21 - Win/Mac
30+
Version: R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
3131

3232
Command, rasterizing(baking) the mask data to a bitmap using the first found UV tag on the sculpt object.
3333
Illustrates the ability to access the mask data on a sculpt object.
@@ -38,49 +38,49 @@ An object plugin can either be a generator, a modifier, a spline generator or a
3838
This is set when the object is registered and affects which functions are called.
3939

4040
### py-dynamic_parameters_object
41-
Version: R18, R19, R20, R21 - Win/Mac
41+
Version: R18, R19, R20, R21, S22, R23 - Win/Mac
4242

4343
Generator, which handle dynamics descriptions and link the parameter angle of first phong tag from the generator.
4444

4545
### py-custom_icon
46-
Version: R21 - Win/Mac
46+
Version: R21, S22, R23 - Win/Mac
4747

4848
Demonstrates how to define a custom icon color according to the new Cinema 4D R21 icon features.
4949

5050
### py-rounded_tube
51-
Version: R13, R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
51+
Version: R13, R14, R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
5252

5353
Generator, generating a c4d.PolygonObject from nothing (like the Cube).
5454
Manages handles to drive parameters (works only in R18+).
5555

5656
### py-double_circle
57-
Version: R19, R20, R21 - Win/Mac
57+
Version: R19, R20, R21, S22, R23 - Win/Mac
5858

5959
Generator, generating a c4d.SplineObject from nothing (like the spline circle).
6060
Consists of two circles in a given plane.
6161
Manages handles to drive parameters.
6262
Registers Help Callback to display user help, if the user click on show help of a parameter.
6363

6464
### py-offset_y_spline
65-
Version: R16, R17, R18, R19, R20, R21 - Win/Mac
65+
Version: R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
6666

6767
Generator, generating a c4d.SplineObject from a child spline object (like the spline mask generator).
6868
Retrieves the first child object and offset all its points on the y-axis by a specific value. Tangents are unaffected.
6969
Demonstrates a Spline Generator that requires Input Spline and Outputs a valid Spline everywhere in Cinema 4D.
7070

7171
### py-spherify_modifier
72-
Version: R13, R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
72+
Version: R13, R14, R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
7373

7474
Modifier, modifying a point object (like the bend deformer).
7575
Supports Falloff (R18 and R19 only).
7676

7777
### py-sculpt_modifier_deformer
78-
Version: R16, R17, R18, R19, R20, R21 - Win/Mac
78+
Version: R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
7979

8080
Modifier, modifying a point object using the pull sculpting brush tool.
8181

8282
### py-gravitation
83-
Version: R12, R13, R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
83+
Version: R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
8484

8585
Particle Modifier, applying a simple gravitation effect for each particles.
8686

@@ -89,7 +89,7 @@ A data class for creating tag plugins.
8989
Tag plugins appear in the Tag menu of the Object Manager and can be attached to objects.
9090

9191
### py-look_at_camera
92-
Version: R13, R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
92+
Version: R13, R14, R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
9393

9494
Tag, force the host object to look at the camera (like the Look At Camera Tag).
9595

@@ -99,7 +99,7 @@ A data class for creating shader (channel shader) plugins.
9999
Shader plugins appear in the popup menu of the channels in the Material Manager
100100

101101
### py-fresnel
102-
Version: R13, R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
102+
Version: R13, R14, R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
103103

104104
Shader, computing a fresnel effect.
105105

@@ -109,7 +109,7 @@ Falloffs appear in any falloff description (unless the flag PLUGINFLAG_HIDE is s
109109
Falloff are deprecated in R20 and replaced by Fields, but Falloff keep working for compatibility reason.
110110

111111
### py-noise_falloff
112-
Version: R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
112+
Version: R14, R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
113113

114114
Falloff, modify how effector sampling occurs in this case using a noise (like the spherical falloff).
115115
Falloff are deprecated in R20 and replaced by Fields, but Falloff keep working for compatibility reason.
@@ -119,13 +119,13 @@ Version: R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
119119
A data class for creating tool plugins.
120120

121121
### py-liquid_painter
122-
Version: R12, R13, R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
122+
Version: R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
123123

124124
Creates a liquid Painter Tool.
125125
Consists of Metaball and Sphere.
126126

127127
### py-tooldata_ui
128-
Version: R15, R16, R17, R18, R19, R20, R21 - Win/Mac
128+
Version: R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
129129

130130
Creates a ToolData with a linkBox on it where it's possible to drag and drop an object.
131131
When this linked object is clicked, its cloned and added to the document in a random position.
@@ -134,22 +134,22 @@ Version: R15, R16, R17, R18, R19, R20, R21 - Win/Mac
134134
A data class for creating brush plugins (not only limited to sculpting).
135135

136136
### py-sculpt_grab_brush
137-
Version: R16, R17, R18, R19, R20, R21 - Win/Mac
137+
Version: R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
138138

139139
Brush Tool, modifying a BaseObject by grabbing all points under the brush.
140140

141141
### py-sculpt_pull_brush
142-
Version: R16, R17, R18, R19, R20, R21 - Win/Mac
142+
Version: R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
143143

144144
Brush Tool, modifying a BaseObject by pulling all points under the brush.
145145

146146
### py-sculpt_twist_brush
147-
Version: R16, R17, R18, R19, R20, R21 - Win/Mac
147+
Version: R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
148148

149149
Brush Tool, modifying a BaseObject by twisting all points under the brush.
150150

151151
### py-sculpt_paint_brush
152-
Version: R16, R17, R18, R19, R20, R21 - Win/Mac
152+
Version: R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
153153

154154
Brush Tool, rasterize the stencil onto the polygons touched by the brush. You will need an active stencil for the brush to work.
155155
Illustrates the ability to access the stencil for a brush and also how to access the bodypaint layer to apply paint.
@@ -158,7 +158,7 @@ Version: R16, R17, R18, R19, R20, R21 - Win/Mac
158158
A data class for creating scene saver plugins (custom scene file format exporter).
159159

160160
### py-ies_meta
161-
Version: R12, R13, R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
161+
Version: R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, S22, R23 - Win/Mac
162162

163163
Exporter, exporting all IES Meta information from the current document to a txt files.
164164
Iterates all objects present in the cache of each objects in the scene to retrieve IES light.
@@ -167,23 +167,23 @@ Version: R12, R13, R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
167167
A data class for creating bitmap loader plugins (custom bitmap file format importer).
168168

169169
### py-xample_loader
170-
Version: R15, R16, R17, R18, R19, R20, R21 - Win/Mac
170+
Version: R23 - Win/Mac
171171

172172
Creates a Bitmap Loader to import a custom picture format into Cinema 4D.
173173

174174
## BitmapSaverData
175175
A data class for creating bitmap saver plugins (custom bitmap file format exporter).
176176

177177
### py-xample_saver
178-
Version: R13, R14, R15, R16, R17, R18, R19, R20, R21 - Win/Mac
178+
Version: R23 - Win/Mac
179179

180180
Creates a Bitmap Saver to export a custom picture format into Cinema 4D.
181181

182182
## PreferenceData
183183
A data class for defining a new preference category in the Cinema 4D preference dialog.
184184

185185
### py-preference
186-
Version: R19, R20, R21 - Win/Mac
186+
Version: R19, R20, R21, S22, R23 - Win/Mac
187187

188188
Exposes parameters as global Preference (EDIT->Preference windows).
189189
Takes care to store data in the world container, so every part of Cinema 4D can access them.
@@ -192,7 +192,7 @@ Version: R19, R20, R21 - Win/Mac
192192
A token is a string that will be replaced during the token evaluation time by a string representation.
193193

194194
### py-render_token
195-
Version: R21 - Win/Mac
195+
Version: R21, S22, R23 - Win/Mac
196196

197197
Registers two Tokens plugin. One visible in the render setting the other one not.
198198
A token is a string that will be replaced during the token evaluation time by a string representation.
@@ -210,7 +210,7 @@ and directly register the plugin by editing a plugin source code.
210210
Even if you encrypt your python plugin it will be just harder for the attackers but not impossible.
211211

212212
### py-licensing_example
213-
Version: R21 - Win/Mac
213+
Version: R21, S22, R23 - Win/Mac
214214

215215
Demonstrates how a plugin can implements a custom licensing in Python.
216216
Opens a dialog which asks for the serial of the user, according to the current user_id logged in.

scenes/py_effector_push_apart_r13.c4d

81.6 KB
Binary file not shown.

scenes/py_effector_random_r13.c4d

18.2 KB
Binary file not shown.

scenes/py_effector_shape_r13.c4d

71.5 KB
Binary file not shown.
-1.49 KB
Binary file not shown.
50.5 KB
Binary file not shown.
2.35 KB
Binary file not shown.
50.1 KB
Binary file not shown.
-57.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)