• Colors on a generator

    Cinema 4D SDK r20 r21 r23 s22 s24 c++
    14
    0 Votes
    14 Posts
    1k Views
    ferdinandF
    Hello @fwilleke80, without further questions or postings, we will consider this topic as solved by Wednesday and flag it accordingly. Thank you for your understanding, Ferdinand
  • Errors building math.framework

    Cinema 4D SDK c++ windows r23
    5
    0 Votes
    5 Posts
    524 Views
    fwilleke80F
    Oh yes, it works. Therefore, the topic is solved Cheers, Frank
  • BaseContainer missing for GvNode created with c4dpy

    Cinema 4D SDK r23 python
    4
    0 Votes
    4 Posts
    868 Views
    ferdinandF
    Hello @beesperester, without any further questions, we will consider this topic as solved by Monday and flag it accordingly. Thank you for your understanding, Ferdinand
  • CKey Auto Tangents

    Cinema 4D SDK c++ r23 s24
    7
    0 Votes
    7 Posts
    2k Views
    M
    Hi @AiMiDi with the latest update of Cinema 4D (R24 SP1), CKey::GetValueLeft/Right and CKey::GetTimeLeft/Right documentation have been improved to mention what was described by @ferdinand. Cheers, Maxime.
  • RenderDocument flags and return values?

    Moved Bugs python r23
    11
    0 Votes
    11 Posts
    2k Views
    César VoncC
    Just for the info, calling the command to open the PictureViewer and RenderDocument with both c4d.RENDERFLAGS_CREATE_PICTUREVIEWER and c4d.RENDERFLAGS_OPEN_PICTUREVIEWER works just fine for me : c4d.CallCommand(430000700) # Picture Viewer c4d.documents.RenderDocument(doc, rdData, bmp, c4d.RENDERFLAGS_EXTERNAL | c4d.RENDERFLAGS_CREATE_PICTUREVIEWER | c4d.RENDERFLAGS_OPEN_PICTUREVIEWER)
  • Nodes and attributes of GvOperatorData plugin

    Cinema 4D SDK c++ r23 s24
    3
    0 Votes
    3 Posts
    355 Views
    fwilleke80F
    Hi Manuel, oh right, that does the trick! Thank you, one bug less! Cheers, Frank
  • Double clicking behaviour in a Field List.

    Cinema 4D SDK c++ r20 r21 r23 s22 s24
    3
    1 Votes
    3 Posts
    393 Views
    kbarK
    This is for my own plugin. I was looking for a flag that I could set. Totally forgot about just checking for the parameter being set. Great solution. Thanks.
  • 2 Votes
    8 Posts
    2k Views
    ferdinandF
    Dear community, this bug has been fixed and will be integrated with an upcoming release of Cinema 4D S24 (hopefully the next one). Cheers, Ferdinand
  • Is MSG_TRANSLATE_POINTS still in use?

    Cinema 4D SDK c++ r23 windows
    5
    0 Votes
    5 Posts
    710 Views
    CairynC
    thank you for looking! Looks as if that message is indeed dead. Without a translation map, it would be fairly useless... The original use I had for it was in a Morph plugin (goes back to R8) so the various morph shapes could keep track of changes done to the original mesh. It's not properly working there any more; guess I know now why My current use is a Symmetry plugin I just finished. Right now, it only works by mapping right points and left points, and duplicating positional changes. I am now looking into possibilities to track added or removed points (and maybe polygons) on one side to duplicate that too. The TRANSLATE messages used to do that, including special information like "point A was merged with point B", but naturally all tools need to support that, and apparently the new kernel has moved on to some other method. I guess I'll investigate whether MSG_POINTS_CHANGED is now carrying the required information...
  • Using CodeEditor_Open()

    Cinema 4D SDK c++ r23 s24
    15
    1 Votes
    15 Posts
    2k Views
    fwilleke80F
    Hi Maxime, Thank you! That’s a lot to take in Cheers, Frank
  • 0 Votes
    3 Posts
    658 Views
    M
    Aha I see, this makes sense for the NormalTag data. And yeah of course cross product is what I need... Regarding the primitives not turning into polygon object, I thought that was happening with a cube, but now after testing it again it definitely is. So I must have been mistaken before. Thanks for the help, going to mark this as solved.
  • 0 Votes
    2 Posts
    360 Views
    ferdinandF
    Dear user, the problem with your example code is that you do use a VoxelizationInterface which is not well suited for this task. The type DistanceQueryInterface(Documentation) is much better suited for the task. You should also be more cautious with statements like the following, taken from your code, voxelRef = maxon::PolyVoxelization().Create() iferr_ignore("Could not create VoxelizationRef"); as stepping over a failure of initialization will lead to crashes. At the end of this posting you will find an example for how to use DistanceQueryInterface as well as some light comments on error handling. I hope this helps and cheers, Ferdinand /* This function expects a point object (A) to be the first object in the scene, followed by a polygon object (B) as the second object. It will then return the index for closest polygon in B for each vertex in A. */ static maxon::Result<void> Pc13296(BaseDocument* doc) { iferr_scope; // Get the first and second node in the scene. The first one is expected // to be a point node, serving as a point source, and the second one is // expected to be a polygon node, serving as a polygon source. BaseObject* node = doc->GetFirstObject(); if (node == nullptr || !node->IsInstanceOf(Opoint)) { ApplicationOutput("Please provide a point object as the first node in the scene."_s); return maxon::OK; } PointObject* pointNode = static_cast<PointObject*>(node); node = node->GetNext(); if (node == nullptr || !node->IsInstanceOf(Opolygon)) { ApplicationOutput("Please provide a polygon object as the second node in the scene."_s); return maxon::OK; } PolygonObject* polygonNode = static_cast<PolygonObject*> (node); // Get access to the point and polygon data and the global transforms of both nodes. const Vector* points = pointNode->GetPointR(); const CPolygon* polygons = polygonNode->GetPolygonR(); const int pointCount = pointNode->GetPointCount(); const int polygonCount = polygonNode->GetPolygonCount(); Matrix mgPointNode = pointNode->GetMg(); // We invert it right away, as we only will need it in this form. Matrix iMgPolygonNode = ~polygonNode->GetMg(); // When an error is being raised by Cinema we should be cautious with using iferr_ingore, as // then the code will keep running in the current scope. In some cases like manipulating an // array like structure this can be useful. But when an initialization of an entity fails, we // almost never want to keep going, as trying to use that not initialized object then will be // a sure fire way to crash Cinema 4D. Instead we can either use iferr_return to simply leave // the current scope, use iferr_throw to throw a specific error or handle it manually with // iferr(). Below you will find a two examples. // Create a reference to the distance query interface. maxon::DistanceQueryRef distanceQuery = maxon::DistanceCalculator().Create() iferr_return; // Pass true for the second argument to voxelize the input to speed up larger queries. Just as // with any optimization, for smaller data sets this voxelization setup might eat up all the // performance benefits gained latter on. iferr(distanceQuery.Init(polygonNode, false)) { ApplicationOutput("Failed to initialize DistanceQueryInterfacae for @", polygonNode->GetName()); return maxon::OK; } // Go over all vertices and query them for the closest polygon (id) in the other mesh. float distance = 0; Vector p; for (int poindId = 0; poindId < pointCount; poindId++) { // The point in the point mesh converted first to global coordinates and then to local // coordinates in the polygon node. We have to do that because the points in the point // source live in their own coordinate system as well the ones in the polygon source. p = mgPointNode * iMgPolygonNode * points[poindId]; maxon::PrimitiveInformation info; distance = distanceQuery.GetClosestMeshPrimitive(p, info); ApplicationOutput("Closest polygon id for point id @: @", poindId, info.GetRealPolyIndex()); } return maxon::OK; } The output/setup: [image: 1617968576078-642545d3-3ffa-467e-9123-cf0a328b18f1-image.png]
  • 0 Votes
    7 Posts
    1k Views
    M
    Hey guys, thanks for the explanations. My only concern is that I can't really do anything besides closing Cinema4D to cancel the operation. Just for reference my plugin is a fluid volume that needs to be visualized in the viewport. This is not an expected workload, stumbled on it by chance, but so can one of the users. Anyway we can close this thread if it's not a bug. Regards, Georgi.
  • Open a GeModalDialog from a Job Observer

    Cinema 4D SDK r20 r21 s22 r23 c++ maxon api
    4
    0 Votes
    4 Posts
    431 Views
    fwilleke80F
    It works perfectly, thanks again! Cheers, Frank
  • EffectorData: Set clone visibility?

    Cinema 4D SDK r20 r21 s22 r23 c++
    3
    1
    0 Votes
    3 Posts
    366 Views
    fwilleke80F
    Works like a charm, thank you! Greetings, Frank
  • Create a Take

    Cinema 4D SDK r23 python
    5
    1
    0 Votes
    5 Posts
    734 Views
    ferdinandF
    Hello @pim, without any further feedback or questions, we will consider this topic as solved by Wednesday and flag it accordingly. Thank you for your understanding, Ferdinand
  • startup script in R23 not working anymore

    Cinema 4D SDK r23 python
    3
    0 Votes
    3 Posts
    508 Views
    M
    hi @ferdinand thank you very much for your response! the python_init.py does the job perfectly great support, thanks a lot! best, marc.
  • Build fails with R23 SDK

    Cinema 4D SDK r23 sdk
    3
    0 Votes
    3 Posts
    643 Views
    K
    Thank you for your advice. The build was successful !!
  • How to download a file in R20+

    Cinema 4D SDK maxon api r21 s22 r23
    5
    0 Votes
    5 Posts
    548 Views
    ManuelM
    hi, by the way, i forgot to talk about the thread thing. This thread might help And of course our manuals about threading Cheers Manuel