Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. SolarPH
    3. Topics
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 21
    • Groups 0

    Topics

    • S

      Is it possible to update the Python Version a release uses?

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK
      3
      0 Votes
      3 Posts
      539 Views
      ManuelM
      hi, technically, it is possible, but you will have to figure it out yourself and be prepare to do a lot lot work. the answer is pretty no. Cheers, Manuel
    • S

      PYTHON - Getting CTsound volume strength on current frame

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK python
      5
      0 Votes
      5 Posts
      920 Views
      ferdinandF
      Hi @SolarPH, without further questions or feedback, we will consider this thread as solved by Monday and flag it accordingly. Cheers, Ferdinand
    • S

      Sound Effector Object Mismatch / Missing / Not Working Fields (R14 (to R18 probably) and R19 comparison)

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK
      4
      1
      0 Votes
      4 Posts
      793 Views
      ferdinandF
      Hi, without further feedback, we will consider this thread as solved by Wednesday and flag it accordingly. Cheers, Ferdinand
    • S

      R19 randomly deletes preset data

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK
      3
      0 Votes
      3 Posts
      668 Views
      ferdinandF
      Hi, without further feedback, we will consider this thread as solved by tomorrow and flag it accordingly. Cheers, Ferdinand
    • S

      Python - InExcludeData initialization problem

      Watching Ignoring Scheduled Pinned Locked Moved General Talk
      5
      1
      0 Votes
      5 Posts
      1k Views
      ferdinandF
      Hi, @SolarPH said in Python - InExcludeData initialization problem: Now I know that initializing the InExcludeData is not InExcludeData.__init__ and the correct way was c4d.InExcludeData(), ... I am not quite sure how you did mean this, but InExcludeData.__init__ is one of the methods called when you invoke c4d.InExcludeData(). Like all double underscore methods __init__ implements an operator, in that case the construction operator. Invoking SomeClass() will first call the constructor SomeClass.__new__ and after that the initialisator SomeClass.__init__. Due to the fact that __new__ only rarely has to be implemented explicitly and because people are accustomed to talking about constructor functions, __init__ is also often called a constructor, while technically it is just the initialisator. A prime example would be both the InExcludeData documentation and my example code, which both talk about a copy constructor, but are actually referring to __init__ and not __new__. Cheers, zipit
    • S

      Exclude Objects from Environment

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK
      3
      0 Votes
      3 Posts
      928 Views
      ManuelM
      Hello, this is a programming forum, if you want to ask question related to "how to use cinema4D" there are more appropriate forum out there. (in different languages) Cheers, Manuel
    • S

      Python NODES - Shouldn't really they can change the scene?

      Watching Ignoring Scheduled Pinned Locked Moved Cinema 4D SDK
      19
      0 Votes
      19 Posts
      4k Views
      ferdinandF
      @SolarPH said in Python NODES - Shouldn't really they can change the scene?: Edit: One thing though, this code kinda has it's own holes, because I encountered a problem ... I never said that it is perfect, I just implemented, what I thought you were after. If you want to find all file paths where the file name matches the file name part of a given preset URL, you could use os.walk. Something like this: def find_preset_url_candidates(url): """Find all OS file paths for which the file name matches the file name of a given MAXON preset url. Args: url (str): The url in the MAXON 'preset' scheme to resolve. Returns: list[str]: The resolved preset paths. Raises: ValueError: When the argument preset_url is not a valid preset url. """ # Half-heartedly sort out some malformed preset urls. url = str(url) if (not url.startswith("preset://") or not url.endswith(".lib4d")): msg = r"Not a preset url: {}." raise ValueError(msg.format(url)) # Split the url into the scheme-path and filename-extension parts _, preset_file = os.path.split(url) candidates = [] # For each preset path walk that path and test if any file matches the # file name of our preset file name. for preset_path in PRESET_PATHS: for root, folders, files in os.walk(preset_path): if preset_file in files: candidates.append((os.path.join(root, preset_file))) return candidates My example does not deal with any fuzzy path searches / does not sort its output by the edit-distance (you would have to do that yourself). To test successfully against something like testrig0.lib4d you would have to implement a Hamming distance or Levenshtein distance to sort out what is close enough. For your example you would need the latter. Or you could just use a regular expression if you do not care about the edit distance. Cheers, zipit