plugincafe / cinema4d_py_sdk Goto Github PK
View Code? Open in Web Editor NEWThe official Cinema 4D Python examples.
Home Page: https://developers.maxon.net/
License: Apache License 2.0
The official Cinema 4D Python examples.
Home Page: https://developers.maxon.net/
License: Apache License 2.0
Is missing from what I can see
Traceback (most recent call last):
File "C:\Users\mikeu\AppData\Roaming\MAXON\CINEMA 4D R20_4FA5020E\plugins\Py-Preference\Py-Preference.pyp", line 105, in Init
self.InitValues(c4d.DescID(c4d.DescLevel(c4d.PYPREFERENCE_CHECK, c4d.DTYPE_BOOL, 0)))
AttributeError:'module' object has no attribute 'PYPREFERENCE_CHECK'
Hi,
So I'm writing a plugin for Cinema 4D, and I'm running into an issue with a very specific python script. The python script is applied to a python tag, attached to a Null Object. Within the Null Object, there are custom User Data parameters assigned, to control functions of the plugin. Essentially what I'm trying to achieve is when a specific boole check box is checked, specific parameters to a feature of this plugin disappear. When the boole check box is unchecked, the specific parameters to the aforementioned features return.
The example below works as a test. However, the issue I'm running into is that when I change the integer value of "1" to any other integer (for example, say "4" for a specific User Data ID, for the descId, (which I thought was used to identify the User Data of a specific feature, like a boole checkbox), the script no longer works.
It seems that the only integer that's accepted in this script is the value of "1".
If that's the case, is there an alternative to descId, to target higher integer values related to specific User Data IDs?
The following is what I have written, which works (as a test) with the value "1" integer for the descId:
#Beginning example
import c4d
#Welcome to the world of Python
def main():
obj = op.GetObject()
UD = obj.GetUserDataContainer()
LightOnOff = 1
ReflectiontEnabled = 3
NewLightOnOff = 4
SkyEnabled = 5
for descId, container in UD:
theID = descId[1].id
if theID == SkyEnabled:
if obj[c4d.ID_USERDATA, 1] == 1:
container[c4d.DESC_HIDE] = True
obj.SetUserDataContainer(descid, container)
if obj[c4d.ID_USERDATA, 1] == 0:
container[c4d.DESC_HIDE] = False
obj.SetUserDataContainer(descid, container)
if theID == ReflectiontEnabled:
if obj[c4d.ID_USERDATA, 1] == 0:
container[c4d.DESC_HIDE] = True
obj.SetUserDataContainer(descid, container)
if obj[c4d.ID_USERDATA, 1] == 1:
container[c4d.DESC_HIDE] = False
obj.SetUserDataContainer(descid, container)
#End example
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.