• ParallelFor vs. ParallelImage

    Cinema 4D SDK c++ r20 sdk macos
    6
    0 Votes
    6 Posts
    648 Views
    fwilleke80F
    Thanks a lot! That helps Cheers, Frank
  • 0 Votes
    4 Posts
    509 Views
    fwilleke80F
    Oh man, it really was the missing message. Never thought it would have such weird consequences to forget that. Thanks guys!
  • R21 Notarization Testing on Mac Catalina

    Cinema 4D SDK r21 c++ macos
    3
    0 Votes
    3 Posts
    355 Views
    D
    Thank you! That does it exactly!
  • Notarization and Older Version of C4D

    Cinema 4D SDK
    13
    0 Votes
    13 Posts
    2k Views
    D
    @r_gigante @kbar Thanks for the infomation. I assumed that was the case and it makes sense, I'm just reluctant to stop supporting older versions of Cinema but it might be time. Riccardo, I think I was using the incorrect version of osX or XCode, not sure which, but using your codesign worked when I moved onto a later version of both and it is correctly signing my R20 compiles. Thanks both of you for all of the help and clarifying of notarization. Dan
  • Strange crashes in R20 & R21

    Cinema 4D SDK c++ r21 r20 macos
    5
    0 Votes
    5 Posts
    1k Views
    r_giganteR
    Thanks for the update Frank. Looking at your "resolutions" I think that the actions you took were responsible, in the first case, to clean the existing derived data for the R20 project, whilst in the second, to refresh the DerivedData subfolder where the newly re-created R21 project was supposed to store intermediate files. Please keep us updated and for the mean time I'm going to set this thread as solved. Cheers
  • 0 Votes
    9 Posts
    1k Views
    S
    I think we are talking past each other. You can of course build any project any way you like. An then make sure that your plugins link to the build result using the link options defined in projectdefinition.txt. But I think you want to include an already existing (non-plugin) project in the solution created by the Project Tool, right? And I think that is not possible. I guess you could add the project manually to the solution created by the Project Tool.
  • BFM_INPUT_DOUBLECLICK in GeUserArea...

    Cinema 4D SDK c++ classic api macos
    7
    0 Votes
    7 Posts
    811 Views
    fwilleke80F
    OK, thank you!
  • R21 CommandData with option - not working on macOS

    Cinema 4D SDK
    11
    0 Votes
    11 Posts
    2k Views
    P
    Ok, thanks @r_gigante... I'll keeping going with the workaround.
  • 0 Votes
    3 Posts
    626 Views
    N
    Hey zipit, thanks for the answer! Exactly what I needed! Best Regards, Florian
  • Modifier parameters change uppon scaling

    Cinema 4D SDK r20 c++ windows macos
    3
    0 Votes
    3 Posts
    556 Views
    N
    Hello Sebastian, thanks for this quick response! I dind't know about this. But this solved my issue! Best Regards, Florian
  • Convenience function for Combobox

    Cinema 4D SDK r19 python macos
    5
    0 Votes
    5 Posts
    1k Views
    S
    Thank you again, @m_adam! I ended up using the C++ method, and it worked like a charm. Also, I appreciate the link to the *args and **kwargs at pythontips.com. It was very helpful to understand those concepts. I do have (many) more questions, but I'll start new posts since they're not related to this topic. My Best, Eric
  • Project tool: Custom plugin name and master solution

    Cinema 4D SDK
    3
    0 Votes
    3 Posts
    848 Views
    M
    Thanks Sebastian! Looking forward for a fix. Meanwhile I'll take care of your recommendation. Best, Robert
  • One to rule them all...

    Moved General Talk
    3
    0 Votes
    3 Posts
    908 Views
    M
    HI Andreas, no worries, this question was not exclusively targeted at Maxon, the opposite is the case. I was hoping for some information by other users here, like @kbar or even @m_adam (back in the days Maxime was not associated with Maxon. ;)) Meanwhile, I'm going to build a toolchain and see what works for me. I'll report back here if I have something to show. That may help someone else.
  • Damaged block

    Cinema 4D SDK r20 c++ macos
    4
    0 Votes
    4 Posts
    823 Views
    r_giganteR
    Hi Roger, thanks for following up. Although I've run a few tests here trying to mix-up STL data-types and Cinema API ones, I wasn't able to reproduce the issue on Xcode 9.4.1 and Cinema R20.057. That said, where possible, we encourage sticking to Cinema 4D API related data-types in order to grant better performance and superior stability. In your specific case I would go for maxon::BaseArray rather than std::vector and I would have switched from std::vector<std::string> to maxon::BaseArray<maxon::String> Would this be an option? Would you like to share a portion of code to reproduce the issue? Best, Riccardo
  • Compatibility between R20 versions

    Cinema 4D SDK c++ windows macos r20
    2
    0 Votes
    2 Posts
    481 Views
    M
    Hi Franck, backward and upward compatibility for the current major release is something we really consider and try our best to not break. Unfortunately, for R20 plugins, they need to be recompiled to make them compatible with R20 SP1. See C++ Index or either in the R20.026 changelog. You may encounter an issue with plugin compiled with R20.011 (see the R20.026 changelog) since you may override maxon dedicated IDs which will break for sure some C4D/plugin stuff. Cheers, Maxime.
  • Deformer update and Fields

    Cinema 4D SDK c++ r20 windows macos
    2
    0 Votes
    2 Posts
    800 Views
    ValkaariV
    using the CheckDirty function seem to be the solution. void Spherify::CheckDirty(BaseObject* op, BaseDocument* doc) { if (falloff) { BaseContainer *data = op->GetDataInstance(); Int32 dirty = falloff->GetDirty(doc, data); if (dirty == lastFalloffDirtyCheck) return; op->SetDirty(DIRTYFLAGS::DATA); lastFalloffDirtyCheck = dirty; } } the full code for the spherify deformer : // deformer object example #include "c4d.h" #include "c4d_symbols.h" #include "main.h" #include "ospherifydeformer.h" #include "c4d_falloffdata.h" #define HANDLE_CNT 2 class Spherify : public ObjectData { public: virtual Bool Init(GeListNode* node); virtual Bool Message (GeListNode* node, Int32 type, void* data); virtual void GetDimension (BaseObject* op, Vector* mp, Vector* rad); virtual DRAWRESULT Draw (BaseObject* op, DRAWPASS type, BaseDraw* bd, BaseDrawHelp* bh); virtual void GetHandle (BaseObject* op, Int32 i, HandleInfo& info); virtual Int32 DetectHandle (BaseObject* op, BaseDraw* bd, Int32 x, Int32 y, QUALIFIER qualifier); virtual Bool MoveHandle (BaseObject* op, BaseObject* undo, const Vector& mouse_pos, Int32 hit_id, QUALIFIER qualifier, BaseDraw* bd); virtual Bool ModifyObject (BaseObject* op, BaseDocument* doc, BaseObject* mod, const Matrix& op_mg, const Matrix& mod_mg, Float lod, Int32 flags, BaseThread* thread); AutoAlloc<C4D_Falloff> falloff; Int32 lastFalloffDirtyCheck; virtual Int32 GetHandleCount(BaseObject *op); virtual void SetHandle(BaseObject *op, Int32 i, Vector p, const HandleInfo &info); virtual Bool CopyTo(NodeData *dest, GeListNode *snode, GeListNode *dnode, COPYFLAGS flags, AliasTrans *trn); virtual Bool GetDDescription(GeListNode *node, Description *description, DESCFLAGS_DESC &flags); virtual Bool AddToExecution(BaseObject *op, PriorityList *list); virtual EXECUTIONRESULT Execute(BaseObject *op, BaseDocument *doc, BaseThread *bt, Int32 priority, EXECUTIONFLAGS flags); virtual void CheckDirty(BaseObject* op, BaseDocument* doc); static NodeData* Alloc() { return NewObjClear(Spherify); } }; Int32 Spherify::GetHandleCount(BaseObject *op) { BaseContainer *bc = op->GetDataInstance(); if (!bc) return 0; if (falloff) return falloff->GetHandleCount(bc) + HANDLE_CNT; return 0; } void Spherify::SetHandle(BaseObject *op, Int32 i, Vector p, const HandleInfo &info) { BaseContainer *bc = op->GetDataInstance(); if (!bc) return; if (falloff) falloff->SetHandle(i, p, bc, info); } Bool Spherify::CopyTo(NodeData *dest, GeListNode *snode, GeListNode *dnode, COPYFLAGS flags, AliasTrans *trn) { Spherify *df = (Spherify*)dest; if (!df) return false; if (falloff && df->falloff) if (!falloff->CopyTo(df->falloff)) return false; return ObjectData::CopyTo(dest, snode, dnode, flags, trn); } Bool Spherify::GetDDescription(GeListNode *node, Description *description, DESCFLAGS_DESC &flags) { BaseObject *op = (BaseObject*)node; if (!op) return false; BaseContainer *data = op->GetDataInstance(); if (!data) return false; if (!description->LoadDescription(op->GetType())) return false; //--------------------------------- // Add the falloff interface if (falloff) { if (!falloff->SetMode(FIELDS, data)) // The falloff parameters have to have been setup before it can be added to the description, this like makes sure of that return false; if (!falloff->AddFalloffToDescription(description, data, DESCFLAGS_DESC::NONE)) return false; } flags |= DESCFLAGS_DESC::LOADED; return true; } void Spherify::CheckDirty(BaseObject* op, BaseDocument* doc) { if (falloff) { BaseContainer *data = op->GetDataInstance(); Int32 dirty = falloff->GetDirty(doc, data); if (dirty == lastFalloffDirtyCheck) return; op->SetDirty(DIRTYFLAGS::DATA); lastFalloffDirtyCheck = dirty; } } Bool Spherify::AddToExecution(BaseObject *op, PriorityList *list) { list->Add(op, EXECUTIONPRIORITY_INITIAL, EXECUTIONFLAGS::NONE); return TRUE; } EXECUTIONRESULT Spherify::Execute(BaseObject *op, BaseDocument *doc, BaseThread *bt, Int32 priority, EXECUTIONFLAGS flags) { BaseContainer *data = op->GetDataInstance(); if (!data) return EXECUTIONRESULT::USERBREAK; if (falloff) if (!falloff->InitFalloff(data, doc, op)) return EXECUTIONRESULT::OUTOFMEMORY; return EXECUTIONRESULT::OK; } Bool Spherify::Message(GeListNode* node, Int32 type, void* data) { if (type == MSG_MENUPREPARE) { ((BaseObject*)node)->SetDeformMode(true); } return true; } Bool Spherify::ModifyObject(BaseObject* mod, BaseDocument* doc, BaseObject* op, const Matrix& op_mg, const Matrix& mod_mg, Float lod, Int32 flags, BaseThread* thread) { BaseContainer* data = mod->GetDataInstance(); Vector p, *padr = nullptr; Matrix m, im; Int32 i, pcnt; Float rad = data->GetFloat(SPHERIFYDEFORMER_RADIUS), strength = data->GetFloat(SPHERIFYDEFORMER_STRENGTH); Float s; Float32* weight = nullptr; if (!op->IsInstanceOf(Opoint)) return true; padr = ToPoint(op)->GetPointW(); pcnt = ToPoint(op)->GetPointCount(); if (!pcnt) return true; FieldInput inputs(padr, pcnt, op_mg); Bool outputsOK = falloff->PreSample(doc, mod, inputs, FIELDSAMPLE_FLAG::VALUE); Float fallOffSampleValue(1.0); weight = ToPoint(op)->CalcVertexMap(mod); m = (~mod_mg) * op_mg; // op -> world -> modifier im = ~m; for (i = 0; i < pcnt; i++) { if (thread && !(i & 63) && thread->TestBreak()) break; p = m * padr[i]; s = strength; if (weight) s *= weight[i]; if (outputsOK) falloff->Sample(p, &fallOffSampleValue, true, 0.0, nullptr, i); s *= fallOffSampleValue; p = s * (!p * rad) + (1.0 - s) * p; padr[i] = im * p; } DeleteMem(weight); op->Message(MSG_UPDATE); return true; } void Spherify::GetDimension(BaseObject* op, Vector* mp, Vector* rad) { BaseContainer* data = op->GetDataInstance(); *mp = Vector(0.0); *rad = Vector(data->GetFloat(SPHERIFYDEFORMER_RADIUS)); } DRAWRESULT Spherify::Draw(BaseObject* op, DRAWPASS drawpass, BaseDraw* bd, BaseDrawHelp* bh) { if (!op->GetDeformMode()) return DRAWRESULT::SKIP; BaseContainer *bc = op->GetDataInstance(); if (!bc) return DRAWRESULT::FAILURE; if (falloff) falloff->Draw(bd, bh, drawpass, bc); if (drawpass == DRAWPASS::OBJECT) { BaseContainer* data = op->GetDataInstance(); Float rad = data->GetFloat(SPHERIFYDEFORMER_RADIUS); Matrix m = bh->GetMg(); m.sqmat *= rad; bd->SetMatrix_Matrix(nullptr, Matrix()); bd->SetPen(bd->GetObjectColor(bh, op)); bd->DrawCircle(m); maxon::Swap(m.sqmat.v2, m.sqmat.v3); bd->DrawCircle(m); maxon::Swap(m.sqmat.v1, m.sqmat.v3); bd->DrawCircle(m); } else if (drawpass == DRAWPASS::HANDLES) { Int32 i; Int32 hitid = op->GetHighlightHandle(bd); HandleInfo info; bd->SetPen(GetViewColor(VIEWCOLOR_ACTIVEPOINT)); bd->SetMatrix_Matrix(op, bh->GetMg()); for (i = 0; i < HANDLE_CNT; i++) { GetHandle(op, i, info); if (hitid == i) bd->SetPen(GetViewColor(VIEWCOLOR_SELECTION_PREVIEW)); else bd->SetPen(GetViewColor(VIEWCOLOR_ACTIVEPOINT)); bd->DrawHandle(info.position, DRAWHANDLE::BIG, 0); } GetHandle(op, 1, info); bd->SetPen(GetViewColor(VIEWCOLOR_ACTIVEPOINT)); bd->DrawLine(info.position, Vector(0.0), 0); } return DRAWRESULT::OK; } void Spherify::GetHandle(BaseObject* op, Int32 i, HandleInfo& info) { BaseContainer* data = op->GetDataInstance(); if (!data) return; if (falloff) falloff->GetHandle(i, data, info); switch (i) { case 0: info.position.x = data->GetFloat(SPHERIFYDEFORMER_RADIUS); info.direction.x = 1.0; info.type = HANDLECONSTRAINTTYPE::LINEAR; break; case 1: info.position.x = data->GetFloat(SPHERIFYDEFORMER_STRENGTH) * 1000.0; info.direction.x = 1.0; info.type = HANDLECONSTRAINTTYPE::LINEAR; break; default: break; } } Int32 Spherify::DetectHandle(BaseObject* op, BaseDraw* bd, Int32 x, Int32 y, QUALIFIER qualifier) { if (qualifier & QUALIFIER::CTRL) return NOTOK; HandleInfo info; Matrix mg = op->GetMg(); Int32 i, ret = NOTOK; Vector p; for (i = 0; i < HANDLE_CNT; i++) { GetHandle(op, i, info); if (bd->PointInRange(mg * info.position, x, y)) { ret = i; if (!(qualifier & QUALIFIER::SHIFT)) break; } } return ret; } Bool Spherify::MoveHandle(BaseObject* op, BaseObject* undo, const Vector& mouse_pos, Int32 hit_id, QUALIFIER qualifier, BaseDraw* bd) { BaseContainer* dst = op->GetDataInstance(); HandleInfo info; Float val = mouse_pos.x; GetHandle(op, hit_id, info); if (bd) { Matrix mg = op->GetUpMg() * undo->GetMl(); Vector pos = bd->ProjectPointOnLine(mg * info.position, mg.sqmat * info.direction, mouse_pos.x, mouse_pos.y); val = Dot(~mg * pos, info.direction); } switch (hit_id) { case 0: dst->SetFloat(SPHERIFYDEFORMER_RADIUS, ClampValue(val, 0.0_f, (Float) MAXRANGE)); break; case 1: dst->SetFloat(SPHERIFYDEFORMER_STRENGTH, Clamp01(val * 0.001)); break; default: break; } return true; } Bool Spherify::Init(GeListNode* node) { BaseObject* op = (BaseObject*)node; BaseContainer* data = op->GetDataInstance(); data->SetFloat(SPHERIFYDEFORMER_RADIUS, 200.0); data->SetFloat(SPHERIFYDEFORMER_STRENGTH, 0.5); if (falloff) { if (!falloff->InitFalloff(nullptr, nullptr, op)) return false; lastFalloffDirtyCheck = -1; } return true; } // be sure to use a unique ID obtained from www.plugincafe.com #define ID_SPHERIFYOBJECT 1001158 Bool RegisterSpherify() { return RegisterObjectPlugin(ID_SPHERIFYOBJECT, GeLoadString(IDS_SPHERIZE), OBJECT_MODIFIER | OBJECT_CALL_ADDEXECUTION, Spherify::Alloc, "Ospherifydeformer"_s, AutoBitmap("spherify.tif"_s), 0); }
  • Use of undeclared identifier 'g_resource'

    Cinema 4D SDK
    8
    0 Votes
    8 Posts
    2k Views
    R
    Good news. And... more good news. The best news are that, after creating a Debug version and running Cinema 4D R20 from XCode, all of a sudden, the plugin started working!!! I then created a simple build (not a Debug one) and it is still working fine The other good news is that I now know how to create a Debug version
  • Undefined symbols for architecture x86_64

    Cinema 4D SDK
    9
    0 Votes
    9 Posts
    3k Views
    R
    This is really weird but after getting this error (and everything all being Ok), the way that I found to get rid of this error is to delete the xcodeproj, the props, the vcxproj and the vcxproj.filters files from the project folder, leaving just the projectdefinition.txt file there, and running the Project Tool again. Then, opening the newly created xcodeproj file, I no longer get this error and it compiles fine.
  • Can't open project file in XCode

    Cinema 4D SDK
    7
    0 Votes
    7 Posts
    1k Views
    R
    I found the culprit. My cmyk.cpp file was inside of a folder. When I got it out and placed it alongside the main.cpp file, the project file created by the Project Tool finally opened in XCode. Now I'm getting other errors, but at least the problem reported in this post is solved.
  • Project Tool failing when installing on Mac

    Cinema 4D SDK project tool macos
    3
    0 Votes
    3 Posts
    958 Views
    F
    Hey that was it! Thanks