Giter VIP home page Giter VIP logo

cinema4d_py_sdk's People

Contributors

gr4ph0s avatar sebastianbach avatar tdapper avatar ypuech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cinema4d_py_sdk's Issues

Cinema4D R20: Py-Preference.pyp do not loading on startup

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'

Python Script - alternative to descId query

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.