Group Details Private


  • RE: NodeData.Message raises confusing exception when method returns non-conformant return value type.

    Hi thanks for the report this was already reported in Phong Tag with ObjectData and this is going to be fixed in the next release.


    posted in Cinema 4D Development
  • RE: Opening a maxon::URL in the browser: Anchors and query parameters?

    Hi @fwilleke80 I can indeed confirm the issue, and I will create a bug report about it.
    This is the mac only issue and with Chrome on Windows everything work as expected.

    Regarding your Python implementation, it's alright to do it as you did 😉

    Have a nice weekend,

    posted in Cinema 4D Development
  • RE: Drawing large amounts of billboarded triangles in the viewport

    Hi @mastergog, thanks for reaching out to us.

    With regard to your request there are a few considerations:

    • the public API currently shipped with Cinema is not providing you with the best options to effectively tackle this problem. Since R22, with the new Viewport system being included in Cinema 4D, there's a not-yet public API that could be used to get this sort of things being natively executed on GPU. Considering the fluid state of such API, please write us directly via email to further specify your final intent and we'll be eager to evaluate the request to get you accessing it.
    • using the BaseDraw class which is the sole option, if accessing the new API is not possible, I have a few considerations:
      • adopt caching mechanism using two checks: one for checking that the point cloud doesn't changes and the second to check that the camera has rotated. The first check will ensure that the volume you're representing has not changed, the second will ensure that you'll redraw your triangles only if the camera has rotated.
      • separate the voxel data acquisition which should happen likely in the ObjectData::GetVirtualObjects(), from the triangles representation which should take place in the ObjectData::Draw(): this will let you use Cinema deformers with your ObjectData and at the same time be sure that triangles will be correctly facing if a volume is deformed.
      • use the BaseDraw::DrawPolygonObject()which should perform better than drawing single triangles one after the other.

    The basic idea is this:

    1. in ObjectData::GetVirtualObjects() you will process your data and return an zero-polygon PolygonObject which contains all the points representing the centroids of your voxels. Only when your data changes the PolygonObject cache will be updated
    2. in ObjectData::Draw() you will take the data generated in the previous step and use it to generate a PolygonObject with camera-pointing-normal triangles. This shall be stored somewhere to be used as a cached geometry, that will be updated only if the camera rotation changes. The in this overridden method you will call the DrawPolygonObject passing to it the just-created PolygonObject.
      Finally, about back-face culling, back-faces are automatically culled unless you specify DRAWOBJECT::NOBACKCULL.

    Cheers, R

    posted in Cinema 4D Development
  • RE: Python Plugin: numpy + scipy - Cinema4D R20

    While zipit is almost all corrected, I just wanted to point:
    NumPy rely on some CPython dll, that need to be compatible with the python executable for more information see Building NumPy for Cinema 4D on Windows.
    However, that's being said, with c4dpy (in R20 it was not included in the regular c4d installation you need to download it from Downloads Page. Then normally you can just run the usual pip -install NumPy it should work (take care to check NumPy have a tendency to break quite often).

    For SciPy you can also install it via pip, but Cinema 4D doesn't officially support any Qt porting, so while it's possible to make it work you may encounter some weird behavior (like closing SciPy windows may close Cinema 4D, SciPy windows can't be docked, etc)

    For the moment there is no easy way to share these modules with your plugin, the easiest is probably to have a script that will run c4dpy and install the needed dependencies.

    Hope this answers your question,

    posted in Cinema 4D Development
  • RE: Making geometry available for IPR rendering

    @tdapper said in Making geometry available for IPR rendering:

    Anyway, the way we thought about it was to use the function publishing interface and implement a call on our object,

    Hi Tim, it sounds like an option more flexible but also more time consuming, but this means that, in any case, the renderer vendor - and consequently - even Maxon should be notified about your APIs ( I think this is what you mean by function publishing interface) and implement specific code to threat your geometries. If there are more arguments than the initial one (which still can be still solved by using the messaging approach) to require to implement and maintain an API then go for it otherwise I would consider a different approach.

    Cheers, R

    posted in Cinema 4D Development
  • RE: Making geometry available for IPR rendering

    Hi Tim, sorry for getting late here.

    I've explored a little bit more your topic and the solution that I would encourage you to explore is something which stems from your second option.

    The idea of drawing something in viewport via BaseDraw::DrawPolygonObject() is, first, pretty straight-forward and, second, performance penalty-free. The first attempt was to override the ObjectData::Draw() method but when it came to hide the representation of the cache generated in the ObjectData::GetVirtualObject() using SetNBit() it caused also the DRAWPASS::OBJECT not to be executed anymore in the overridden Draw() method with the consequence of not being possible to show the low-res mesh in the viewport and hide the high-res for rendering purposes at the same time.
    Given that I had to consider to split the viewport visualisation and the object cache generation using respectively a SceneHookData and an ObjectData. in this case overriding the SceneHookData::Draw() method is was capable to draw in viewport the low-res version and feed rendering engines (either in IPR or offline mode) with the desired cache (below plane is the "low-res" object, sphere is the "high-res" one).


    Unfortunately the solutions was indeed better but far form being perfect. This come by the fact that some of our cloners (MoGraph Cloner to name one) when representing in scene the cloned elements looks for the cache of the nested object and completely discard what I've forced with the SceneHookData::Draw() to represent in viewport (which is reasonable). This is something that, at the moment, can't be prevented though.


    Cheers, R

    posted in Cinema 4D Development
  • RE: GetDescription for Document Modelling Settings

    Hi @mikeudin this can be done with the next code:

    import c4d
    def GetModelingNode():
        ID_SNAP_SCENEHOOK = 440000111
        snapSceneHook = doc.FindSceneHook(ID_SNAP_SCENEHOOK)
        for branch in snapSceneHook.GetBranchInfo(c4d.GETBRANCHINFO_NONE):
            if branch["name"] == "MdSH":
                if branch["head"] is not None:
                    return branch["head"].GetFirst()
        raise RuntimeError("Unable to find the Modeling Node")
    def main():
        mod = GetModelingNode()
        for bc, paramid, groupid in mod.GetDescription(c4d.DESCFLAGS_DESC_0):
           print (bc[c4d.DESC_NAME], bc[c4d.DESC_IDENT],paramid ,groupid) 
    # Execute main()
    if __name__=='__main__':


    posted in Cinema 4D Development
  • RE: Cinema 4D Client R21 Service Creation

    Hi @thestraycat, I'm sorry to disappoint you but the option to start the TeamRender Client via NSSM or SC or WinSW has not yet been restored.

    I can only ask, to contact us via our official email address, to better describe the impact this issue is causing on your work to escalate the discussion.

    Best, Riccardo

    posted in General Programming & Plugin Discussions
  • RE: c4d.Vector.__init__ does not accept named arguments

    Hi @zipit thanks a lot, the issue is not really named arguments, but how we implemented internally the function.
    Previously the policy was to make Python a perfect clone of C++, and in C++ there is the concept of overload which doesn't exist in Python.
    So in C++ you can initialize a Vector with the next constructors:

    • Vector() // produce Vector(0, 0, 0)
    • Vector(0.5) // produce Vector(0.5, 0.5, 0.5)
    • Vector(0.1, 0.5, 1)

    But there is no overload for 2 arguments. And here is the cause of the issue if I can tell.
    But I completely understand the issue and the fact that the code is not really pythonic, so in this case, this is not a problem, and I will adapt the method to make it more pythonic and make x, y, z optional argument as the documentation suggested.

    Note that this issue may be present in some other area (like Matrix), I will try to look at it and fix them, but if you(the community) could also report us when something like that occurs, this would be very welcome.

    However, in some situations, we have the exact same issue but there is no easy fix because default values are not easily determinable (a good example is FieldList.DirectSample.

    Finally, the fact it didn't raise anything, this is not normal.

    Hope it answers your question,
    Maxime :)

    posted in Cinema 4D Development
  • RE: Ability to set DLG_TYPE_ASYNC Width & Height

    Hi sorry for the late reply I had to dig down some old code and in fact this can be done by doing:
    xpos=-3, ypos=-3

    return myDialog.Open(dlgtype=c4d.DLG_TYPE_ASYNC, xpos=-3, ypos=-3,
                pluginid=PLUGIN_ID, defaultw=560, defaulth=560)

    Unfortunately, this means, your dialog will not be anymore centered, but this is for the moment the only possible way to do it.

    posted in Cinema 4D Development