Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. baca
    3. Topics
    • Profile
    • Following 0
    • Followers 0
    • Topics 28
    • Posts 108
    • Best 10
    • Controversial 0
    • Groups 0

    Topics created by baca

    • bacaB

      Spline Generator GetVirtualObjects() + GetContour()

      Cinema 4D SDK
      • python 2025 • • baca
      4
      0
      Votes
      4
      Posts
      564
      Views

      ferdinandF

      We will very likely never abandon this technique. The issue is more that there are a lot of hacks in the Spline Mask code and almost none of them are shown in the public code example. And we cannot publish all of these hacks both for strategic (we do not want to show all of our internals) and practical reasons (we cannot explain all the nitty gritty details there).

      It was not such a good decision to publish that code example; which as far as I understood came to pass as a user asked as to how the Spline Mask object has been realized. But we probably should just have said "no" then. Just as much as I probably should not have shown you that simulation hack. Hacks lead to more hacks and more problems.

      Cheers,
      Ferdinand

      PS: And to be super verbose, you ONLY need this pattern when you "have to" implement a spline that has other (spline) objects as inputs. When you have implemented regular splines like this, you should probably revert that.

    • bacaB

      Syntax highlight in VS Code under MacOS

      Cinema 4D SDK
      • python macos • • baca
      4
      0
      Votes
      4
      Posts
      630
      Views

      ferdinandF

      I would heavily recommend using the extension, as it will automatically curate the paths for you. I.e., when you use the extension and connect to a Cinema 4D instance, it will make sure that the dummy modules of that Cinema 4D version are on the search paths.

      But when you really do not want to use it, you can also just edit your config so that the dummy module paths are discoverable for auto complete and the linter.
      2a76cd6c-35aa-451f-82db-02b03694e72d-image.png

      What you will need in any case, is the Python and Pylance extension for VS Code, as they are the extensions which make use of these settings. When you install the connector, they will be installed automatically as a dependency.

      0b5d77af-5f23-4203-9a0a-276b8eafc62e-image.png

      Cheers,
      Ferdinand

    • bacaB

      Browsing field layers causes dangling/not alive references

      Bugs
      • 2024 python • • baca
      4
      0
      Votes
      4
      Posts
      1.1k
      Views

      ferdinandF

      Hey @baca,

      feel free to send us a mail to sdk_support(at)maxon(dot)net in case you cannot share code publicly. But we have to have a look at your code to see what is going on. When you say this worked before, we either have a soft regression (you did something which you should not but it somehow worked and we now broke that) or a strong one (we broke something that should work) on our hands. And for that we will need code to see what is going on.

      And I would not say that the performance penalty is dramatic, it more likely will be neligable. But if everyone would do that everywhere, Cinema 4D would come to a crawl. I would say you can ship your plugin with that "fix" when it does not cause any issues for you. But we should work towards solving this properly.

      Cheers,
      Ferdinand

    • bacaB

      Get clone position over spline for Spline Based Cloner/Matrix

      Cinema 4D SDK
      • python • • baca
      2
      0
      Votes
      2
      Posts
      380
      Views

      M

      Hi @baca, sadly it is not possible to get the exact same random in Python than the one used internally for this feature. So the only way would be to actually clone some objects an retrieve their position as shown in read_modata_color.py. The previous example retrieve the color and not the position, so instead of retrieving the MODATA_COLOR, use the MODATA_MATRIX.

      Cheers,
      Maxime.

    • bacaB

      Python Effector with custom FieldList

      Cinema 4D SDK
      • python 2024 • • baca
      3
      0
      Votes
      3
      Posts
      551
      Views

      M

      Hi @baca, this is unfortunately not possible there is some default CheckDirty in place to support the default FiledList, but since you can not override CheckDirty in an effector yourself you can't add another FieldList dependency check.

      Cheers
      Maxime.

    • bacaB

      Utilizing InExclude for advanced use

      Cinema 4D SDK
      • python • • baca
      7
      0
      Votes
      7
      Posts
      881
      Views

      bacaB

      @m_adam good to know, thanks.

    • bacaB

      Utilize Mograph Effectors to be used with custom generators

      Cinema 4D SDK
      • python • • baca
      3
      0
      Votes
      3
      Posts
      374
      Views

      bacaB

      Hi @m_adam ,

      That's sad... Thanks, anyway.

    • bacaB

      Send/Receive Messages in TagData/ObjectData plugins

      Cinema 4D SDK
      • python • • baca
      5
      0
      Votes
      5
      Posts
      640
      Views

      bacaB

      @ferdinand Thanks again

      I'll have time to check it later today.
      But it seems clear.

    • bacaB

      VC_FLAGS

      Cinema 4D SDK
      • 2024 python 2023 • • baca
      2
      0
      Votes
      2
      Posts
      318
      Views

      M

      Hi @baca VC_SAFETY has been removed in 2023.1, you do not need it anymore, since the message can't fail anymore.

      You should keep it for old code but for new code, just leave the vc_flags empty will be enough.
      Cheers,
      Maxime.

    • bacaB

      Force polygon object to generate it's cache

      Cinema 4D SDK
      • python 2024 • • baca
      7
      0
      Votes
      7
      Posts
      994
      Views

      bacaB

      Thanks @ferdinand,

      Thats gone too far, we can close this subj now.
      I think I have a solution already.

      I just wasn't clear enough in the beginning, I just wanted to know if PolygonObject can be forced to produce it's cache object by a command.

      I made an experiment where I spawn flat geometries between other flat geometries. Like planes in-between of deformed soft body planes. Here's working example:
      Setup:
      417b1a04-77c9-4163-bc6f-36c2800323f5-image.png
      And simulation:
      cloth_multiply__03_.gif

      Once you clone original geometry — it's flat, and there would be intersections and simulation will be broken.
      So you need to blend newborn geo point positions in-between of existing geometry points.
      Once you blend it — there are no intersections, it nicely continue with soft body simulation.
      But softbody dynamics build constraints for every new object. And if geometry first appears as deformed — wrong constraints are initialized, and each new object becomes crumpled real quick.
      Also there's "Mix Animation" -> "Follow Shape" checkbox, which rebuild constraints (or adjusts them - who knows?) — and it reads original point positions, as I understood.

      So I had to have both — original geo, and cache.
      Where cache used to simulate geometry in 3D, and original object (CacheParent?) will be used for constraints.

    • bacaB

      Issue with return values of VertexColorTag.GetAllHighlevelData()

      Cinema 4D SDK
      • python • • baca
      5
      0
      Votes
      5
      Posts
      587
      Views

      M

      Hi just to let you know that with the release 2024.2 the issue have been fixed and it is now possible to retrieve the value of a Vertex Color Tag in point mode.

      Cheers,
      Maxime.

    • bacaB

      Spline Round Tool behave issue

      General Talk
      • python 2024 • • baca
      6
      0
      Votes
      6
      Posts
      1.0k
      Views

      ferdinandF

      Hey @baca,

      Just as an FYI, this bug has been fixed and it will be included in one of the upcoming releases of Cinema 4D, quite likely the next release.

      Cheers,
      Ferdinand

    • bacaB

      c4d.MCOMMAND_EXPLODESEGMENTS makes target object dead

      Cinema 4D SDK
      • macos python 2024 • • baca
      6
      0
      Votes
      6
      Posts
      964
      Views

      bacaB

      @ferdinand said in c4d.MCOMMAND_EXPLODESEGMENTS makes target object dead:

      Select 0th polygon in a mesh. SMC: MCOMMAND_SELECTCONNECTED SMC: MCOMMAND_SPLIT Delete the selected polygons. When no polygons are left, exit, otherwise goto 1.

      Oh, great idea.
      Not that elegant, but seems legit.
      Thanks again.

    • bacaB

      Object Generator as Particles

      Cinema 4D SDK
      • python • • baca
      2
      0
      Votes
      2
      Posts
      330
      Views

      ManuelM

      Hi,

      sorry, the display of this tab is hardcoded an only available for a couple of builtin objects.

      What you can do is have a Matrix object in object mode that point to your generator, the rs tag being applied to the matrix object.

      You can also create that setup inside your generator. Below, i am using a cube but that could be your PointObject instead.

      Keep in mind that python is slow, using it for point cloud or anything related to particles might be super slow.

      from typing import Optional import c4d doc: c4d.documents.BaseDocument # The document evaluating this python generator op: c4d.BaseObject # The python generator hh: Optional["PyCapsule"] # A HierarchyHelp object, only defined when main is executed def main() -> c4d.BaseObject: . cube = c4d.BaseObject(c4d.Ocube) parent = c4d.BaseObject(c4d.Onull) cube.InsertUnder(parent) matrix = c4d.BaseObject(c4d.Omgmatrix) matrix.InsertUnder(parent) matrix[c4d.ID_MG_MOTIONGENERATOR_MODE] = c4d.ID_MG_MOTIONGENERATOR_MODE_OBJECT matrix[c4d.MG_OBJECT_LINK] = cube matrix[c4d.MG_POLY_MODE_] = c4d.MG_POLY_MODE_VERTEX rsTag = matrix.MakeTag(1036222) rsTag[c4d.REDSHIFT_OBJECT_PARTICLE_MODE] = 2 return parent

      Cheers,
      Manuel

    • bacaB

      Cinema 4D R2023 - c4d.plugins.RegisterObjectPlugin issue

      Cinema 4D SDK
      • 2023 python • • baca
      6
      0
      Votes
      6
      Posts
      803
      Views

      M

      @baca said in Cinema 4D R2023 - c4d.plugins.RegisterObjectPlugin issue:

      Any suggestion how to properly handle that kind of issues --
      just catch exception and warn user using message box somehow?

      Correct you can catch the OsError and check if there is the word 50 in the exception message.

      Would it be reasonable to switch to NodeData from ObjectData --
      It depends of your plugin if this is at the end an ObjectData then it's irrelevant, if this is just an object that you store in a list in memory or in a custom GeListHead then NodeData is perfectly relevant.

      does RegisterNodePlugin has separate 50 plugins registrations?

      Yes each type have 50 plugins.

      What's the logic behind plugin initialization order -- alphabetical, date-based, random?

      Folders from g_additionalModulePath are iterated by alphabetical order and each files are then iterated by alphabetical order too.

      Cheers,
      Maxime.

    • bacaB

      Normal Move command has no effect in R2023

      Bugs
      • python • • baca
      3
      0
      Votes
      3
      Posts
      694
      Views

      bacaB

      @m_adam thanks!

    • bacaB

      Touch input objects withot resetting its cache

      Cinema 4D SDK
      • python • • baca
      6
      0
      Votes
      6
      Posts
      811
      Views

      ferdinandF

      Hey @baca,

      as I said, the control object structure you want is not possible. I tried and wrote the necessary code when I answered here initially, and Cinema 4D will really start to freak out. You cannot have nested hierarchies of muted caches. If you really want to do this, then you must use the approach proposed by me. If you want to also hide the objects in renderings, then you will have to also set that parameter.

      If you poke around long enough, you might find a solution by muting the caches, but this is out of scope of support. As I said, I did already try when I wrote my first posting, maybe you have more luck. But as also stated in my first posting, you are poking here the sleeping bear called "classic API node dependencies".

      Cheers,
      Ferdinand

    • bacaB

      Draw editable spline in the viewport

      Cinema 4D SDK
      • python • • baca
      5
      0
      Votes
      5
      Posts
      947
      Views

      bacaB

      @ferdinand thanks for explanations and example.

    • bacaB

      CSTO over object.GetClone() produces excess geometry

      Cinema 4D SDK
      • python • • baca
      5
      0
      Votes
      5
      Posts
      623
      Views

      bacaB

      @m_magalhaes Thanks Manuel,
      I appreciate your wise support every time.

      Merry Xmas and Happy New Year!

    • bacaB

      GetAndCheckHierarchyClone + dynamics

      Cinema 4D SDK
      • • • baca
      7
      0
      Votes
      7
      Posts
      895
      Views

      bacaB

      @ferdinand Thanks, no issues so far.