Generating a usable spline with a Python Generator



  • This topic has been broached before over the years, but I think it should be mentioned again.

    There is no easy way to make a spline generated with a python generator that is usable in other parts of the program due to the internal hierarchy within c4d python and caching / generating "contours" as noted with the Python Generator object etc.

    The only solution available to generate procedural splines (usable in other generator objects) is that users are expected to make full ObjectData plugins.. which is unnecessarily time consuming, and places a much larger mountain to climb in front of new users of c4d python. I think this feature would be incredibly powerful and time saving if it was easier, even as someone who knows how to write ObjectData plugins.

    I hope you will please consider adding this functionality to return usable splines in the Python Generator in a future release or update to c4d python. Thanks for your consideration!



  • Hi @jenandesign,

    thank you for reaching out to us with your feature request. First of all I would like to point out that feature requests - unless they are directly related to one of Cinema 4D's public APIs - are not within the scope of the SDK team and this forum. The correct place to ask for such a feature would be the the Maxon Support portal.

    Secondly, it seems worth mentioning that a Python generator object returning spline "geometry" is supported by most features in Cinema 4D. One can for example extrude, loft, lathe etc. such Python generator sourced spline object. It is only in a few instances where one has a BaseLink to SplineObject in a BaseList2D, and that node either ensures directly via the BaseLink GUI flag DESC_ACCEPT or by checking manually if the linked object is a spline, where a Python generator object won't work. The Python generator object is of course also missing the Osplineprimitive default parameters, but these can be mimicked if necessary.

    And last, but not least - It would not be that hard to implement such a Python spline generator plugin as a third party. One would have basically just to throw a MULTILINEEDIT with syntax highlighting into an ObjectData plugin and then insatiate and poll the user provided code as a module and feed its outputs into the respective methods of ObjectData. I understand this is not quite the answer you were looking for, but unfortunately the only one, we can currently provide.

    Thank you for your understanding,
    Ferdinand



  • Hi @jenandesign,

    thank you for reaching out to us with your feature request. First of all I would like to point out that feature requests - unless they are directly related to one of Cinema 4D's public APIs - are not within the scope of the SDK team and this forum. The correct place to ask for such a feature would be the the Maxon Support portal.

    Secondly, it seems worth mentioning that a Python generator object returning spline "geometry" is supported by most features in Cinema 4D. One can for example extrude, loft, lathe etc. such Python generator sourced spline object. It is only in a few instances where one has a BaseLink to SplineObject in a BaseList2D, and that node either ensures directly via the BaseLink GUI flag DESC_ACCEPT or by checking manually if the linked object is a spline, where a Python generator object won't work. The Python generator object is of course also missing the Osplineprimitive default parameters, but these can be mimicked if necessary.

    And last, but not least - It would not be that hard to implement such a Python spline generator plugin as a third party. One would have basically just to throw a MULTILINEEDIT with syntax highlighting into an ObjectData plugin and then insatiate and poll the user provided code as a module and feed its outputs into the respective methods of ObjectData. I understand this is not quite the answer you were looking for, but unfortunately the only one, we can currently provide.

    Thank you for your understanding,
    Ferdinand



  • Hi,

    without further feedback, we will consider this thread as solved by Wednesday and flag it accordingly.

    Cheers,
    Ferdinand


Log in to reply