• Debug Python related CRASH

    10
    0 Votes
    10 Posts
    2k Views
    indexofrefractionI
    @zipit just FYI, the CacheInterface immediately crashes R20 but works on R21 @m_adam Ok, thanks! I was doing this in every Python Tag and I have 100-200 of those in the File. I don't really need to do this, it was just a "beauty" thing... that did end up ugly
  • Get the Next Object of doc.SearchObject() Method?

    r21 python
    3
    0 Votes
    3 Posts
    657 Views
    B
    @m_adam Ah gotcha. Thanks for the confirmation and the sample code.
  • Crash in ChannelShader plugin

    s22 c++ macos
    9
    1
    0 Votes
    9 Posts
    815 Views
    fwilleke80F
    I’m confident they will find out Thanks for everything!
  • C4D R21.207 Console don't do anything

    r21 python
    10
    1
    0 Votes
    10 Posts
    2k Views
    C
    Finally fix it! I reinstalled c4d and everything goes well! Thank you for all you helps!
  • Copy Pixels from Active BaseDraw?

    python
    5
    0 Votes
    5 Posts
    592 Views
    ?
    Hi, Thank you @m_adam and @zipit . I am specifically interested in copying the Viewport pixels for speed. Thank you both for your help.
  • Shader that gets data from an object: Refresh

    r20 r21 s22 maxon api c++
    6
    0 Votes
    6 Posts
    1k Views
    fwilleke80F
    It works like a charm! Thank you again! I was surprised at how little code was required. Sharing is caring. In case anyone needs it, here's the code: #include "ge_prepass.h" #include "c4d_general.h" #include "c4d_baselinkarray.h" #include "c4d_basedocument.h" /// /// \brief Registers observers and sends messages to them. /// class Observable { public: /// /// \brief Subscribes a new observer. /// /// \param[in] observer Pointer to an AtomGoal /// \param[in] doc The document that owns the AtomGoal /// /// \return A maxon error object if anything went wrong, otherwise maxon::OK /// maxon::Result<void> Subscribe(C4DAtomGoal *observer, BaseDocument *doc); /// /// \brief Unsubscribes an observer /// /// \param[in] observer Pointer to an AtomGoal that has previously been subscribed /// \param[in] doc The document that owns the AtomGoal /// void Unsubscribe(C4DAtomGoal *observer, BaseDocument *doc); /// /// \brief Sends a messages to all subscribed observers /// /// \param[in] type Message type /// \param[in] doc The document that owns the subscribed observers /// \param[in] data Optional message data /// void Message(Int32 type, BaseDocument *doc, void *data = nullptr) const; private: BaseLinkArray _observers; }; maxon::Result<void> Observable::Subscribe(C4DAtomGoal *observer, BaseDocument *doc) { if (!observer) return maxon::NullptrError(MAXON_SOURCE_LOCATION, "Observer must not be nullptr!"_s); // Check if this observer is already registered const Int32 observerIndex = _observers.Find(observer, doc); if (observerIndex != NOTOK) return maxon::OK; // Register new observer if (!_observers.Append(observer)) { return maxon::OutOfMemoryError(MAXON_SOURCE_LOCATION, "Failed to add observer to the list!"_s); } return maxon::OK; } void Observable::Unsubscribe(C4DAtomGoal *observer, BaseDocument *doc) { if (observer && doc) { const Int32 observerIndex = _observers.Find(observer, doc); if (observerIndex != NOTOK) { _observers.Remove(observerIndex); } } } void Observable::Message(Int32 type, BaseDocument *doc, void *data) const { for (Int32 i = 0; i < _observers.GetCount(); ++i) { C4DAtomGoal *atom = _observers.GetIndex(i, doc); if (atom) { atom->Message(type, data); } } }
  • Getting a GadgetID during BFM_INTERACTSTART

    python
    6
    0 Votes
    6 Posts
    683 Views
    ?
    Thank you both! @zipit & @m_magalhaes
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • Hide description element using MessageData::CoreMessage() function

    r21
    5
    0 Votes
    5 Posts
    1k Views
    ManuelM
    hi, I'm a bit surprised that your render can be triggered from a NodeData (but why not) But i don't understand why you can't use GetDDescription to update your node. That's what i did (in a probably too naive way) but you got the idea. I just got a boolean display_aboard on my ObjectData and i switch it as i needed. If i presse the button, i switch and i set dirty my node, if i receive the message that the render is finished (or stopped) i set my bool to false and i SetDirty my node. static const Int32 g_pc12584ButtonID = 1000; class pc12584_object : public ObjectData { INSTANCEOF(pc12584_object, ObjectData); public: static NodeData* Alloc() { return NewObjClear(pc12584_object); }; Bool Init(GeListNode* node) override { display_aboard = false; return true; } BaseObject* GetVirtualObjects(BaseObject* op, HierarchyHelp* hh) override { BaseObject* null = BaseObject::Alloc(Onull); return null; } Bool GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC& flags) override { if (!description->LoadDescription(Obase)) return false; const DescID* singleid = description->GetSingleDescID(); const Int32 ID = g_pc12584ButtonID; const DescID cid = DescLevel(ID, DTYPE_BUTTON, 0); if (!singleid || cid.IsPartOf(*singleid, nullptr)) { BaseContainer bc = GetCustomDataTypeDefault(DTYPE_BUTTON); bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BUTTON); if (display_aboard) bc.SetString(DESC_NAME, "Aboard Render"_s); else bc.SetString(DESC_NAME, "Render"_s); bc.SetInt32(DESC_ANIMATE, DESC_ANIMATE_OFF); bc.SetInt32(DESC_SCALEH, 1); description->SetParameter(cid, bc, DescLevel(ID_OBJECTPROPERTIES)); } flags |= DESCFLAGS_DESC::LOADED; return SUPER::GetDDescription(node, description, flags); } Bool Message(GeListNode* node, Int32 type, void* data) override { switch (type) { case MSG_DESCRIPTION_COMMAND: { DescriptionCommand* dc = (DescriptionCommand*)data; const Int32 id = dc->_descId[0].id; if (id == g_pc12584ButtonID) { display_aboard = !display_aboard; node->SetDirty(DIRTYFLAGS::DESCRIPTION); } break; } case g_pc12584Message: { display_aboard = false; node->SetDirty(DIRTYFLAGS::DESCRIPTION); break; } } return SUPER::Message(node, type, data); }; private: Bool display_aboard = false; }; // function to send a message to the ObjectData. static maxon::Result<void> PC12854_Message(BaseDocument* doc) { iferr_scope; // update the first object BaseObject* op = doc->GetFirstObject(); if (op == nullptr) return maxon::NullptrError(MAXON_SOURCE_LOCATION); op->Message(g_pc12584Message); return maxon::OK; } Cheers, Manuel
  • Adding Keyboard Message: KEY_ENTER & KEY_TAB

    4
    0 Votes
    4 Posts
    592 Views
    ManuelM
    hi, @indexofrefraction, as @blastframe said, let's keep that thread clean and ask your question in another thread, this is working on my system. @blastframe , we will take into consideration your request. Cheers, Manuel
  • Store generator's property

    python
    4
    0 Votes
    4 Posts
    615 Views
    ManuelM
    hi can we considered this thread as resolved ? Cheers, Manuel
  • 0 Votes
    11 Posts
    2k Views
    ManuelM
    hi can we considered this thread as solved ? (even if there's no real right answer) Cheers, Manuel
  • Python Tag does not update during rendering

    python
    9
    0 Votes
    9 Posts
    1k Views
    ManuelM
    hi, we got some information in our documentation. For example you can't add an object in the document from a tag while the generator can return a hierarchy. But you can easily draw information on the viewport with a tag. Cheers, Manuel
  • Xcode update to 11.7... do it or not?

    macos
    3
    0 Votes
    3 Posts
    350 Views
    fwilleke80F
    OK, thanks!
  • Disable a Command Plugin

    python
    11
    0 Votes
    11 Posts
    1k Views
    ?
    @m_magalhaes Thanks Manuel (and @zipit ) for your help. Please let us know about why the Message isn't working.
  • Something to watch out for with GetAllAssets

    s22 c++
    2
    2 Votes
    2 Posts
    524 Views
    M
    Hi Thanks for the extra warning, just in case it was stated in the S22 API change. Cheers, Maxime.
  • Changing camera/take/render setting in the render queue

    3
    0 Votes
    3 Posts
    1k Views
    B
    @m_adam Thanks. I gave that a shot, but unfortunately, it's still adding multiple copies of the same camera. Am I doing something wrong? docs = c4d.documents doc = docs.GetActiveDocument() cams = getSelectedCameras(doc.GetActiveObjects(0)) path = doc.GetDocumentPath() cFile = path + '\\' + fName queue = docs.GetBatchRender() queue.Open() base = doc.GetActiveBaseDraw() for cam in cams: docs.LoadDocument(cFile, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS) base.SetSceneCamera(cam) docs.SaveDocument(doc, cFile, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_C4DEXPORT) queue.AddFile(cFile, queue.GetElementCount())
  • set sculpting layer data from high resolution mesh.

    3
    1
    0 Votes
    3 Posts
    555 Views
    J
    @m_magalhaes Thank you for reply. I am going to use it for this project. Hope it gets fixed soon. Thank you.
  • BaseBitmap.CopyPartTo() with grayscale image

    python sdk
    5
    0 Votes
    5 Posts
    1k Views
    oli_dO
    Thank you very much Maxime for the reply. I'm looking forward to the r23 and the python 3 with a lot of impatience. Cheers
  • TreeView Multiple Selection With LMB

    Moved
    13
    0 Votes
    13 Posts
    3k Views
    Danchyg1337D
    @m_adam Now i see the problem. Thanks alot for helping!