• C++ The product of the Matrix and another type function does not exist?

    8
    0 Votes
    8 Posts
    1k Views
    Y
    Hello @ferdinand I've tested it a bit and now I've finished with this: instead of this: matrixA= c4d.utils.MatrixMove(c4d.Vector(0,10,0)) matrixB = myObject.GetMg().__mul__(matrixA) to this: Matrix matrix = MatrixMove(Vector(0, 10, 0)); Vector vector = myObject->GetMg() * matrix.off; It looks it works for me. Thank you again!
  • "two-leveled" ID ( [50004,1] ) of a Constraint Tag? C++

    c++ r25
    3
    0 Votes
    3 Posts
    560 Views
    Y
    Hello @ferdinand , Thank you for your answer! I made a search by the forum but have lost your post above because of I sorted topics only for a C++. My bad) I also read the C++ manual for a DescID and DescLevel and the examples in there. But they are not cover the examples like my above for a [50004,1] - IDs (or maybe I've not found). For a Python version of my plugin I did not have a problem with understanding the access to the parameters at all. But on C++... For example I stuck in my mind with figuring out how does the second DescLevel work. But after your explanation above I understand it. The first level DescLevel in your code locates this sub-container: [image: 1634311057292-%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5_2021-10-15_181737.png] And next with the codeline: const DescLevel secondLevel (0, DTYPE_LONG, 0); we access into the one of this items. So I've changed your your code into: const DescLevel secondLevel (1, DTYPE_LONG, 0); and I got access into the 5004,1 item. Thank you very much!
  • Contentbrowser Python API

    3
    0 Votes
    3 Posts
    749 Views
    H
    Thanks Maxime. I will try to solve this differently for now. And update my Scripts again when the Python API is ready. Thanks again.
  • Effector Updates

    c++ windows r25 sdk
    2
    0 Votes
    2 Posts
    486 Views
    ferdinandF
    Hello @JohnTerenece, thank you for reaching out to us. Unfortunately, our answer is mostly the same as it was for the previous topic on this plugin of yours. You are using the MoData tags in a way not intended by us. It is not supported by our SDK to implement a custom MoGraph generator and you are therefore not intended to populate and manage your own MoData tags. There is nothing preventing you from doing it anyways, this however will then be out of scope of support as declared in our Forum Guidelines under "Scope of Support". We cannot debug your code for you, especially when the employed techniques are a violation of point one listed here. This is also outlined in "Scope of Support". You are also misusing the maxon API. Specifically, the error system, as you cannot just step over all errors which are returned. Which is what you do when you store them in some fields attached to your plugin implementation; never to be used or looked at again. Which can introduce all sorts of problems. The cases I saw do look unlikely to go wrong, but this is still a fundamental misuse of our API. See the end of my posting for details. Finally, about your question. I would look at your CheckDirty(), since this is the likely culprit for your problems. But we cannot debug that for you. When you can show us that something is not being flagged as dirty what was flagged before, we will be glad to provide a context for that. Please also note that example code should be condensed as also outlined in our Forum Guidelines. I understand that this is not the support you did hope for, but these limitations of scope of support must be enforced by us to a certain degree, as it would otherwise become a boundless task. Thank you for your understanding, Ferdinand maxon::Result Example What you do: void EffectorTestClass::CheckDirty(BaseObject *op, BaseDocument *doc) { // ... if (op->GetDown() != nullptr) // This could fail and you just step over it. resultBaseObject = objArray.Append(op->GetDown()); // ... flags = data->GetFlags(doc, object); if ((flags & 1) == 1) { // This could fail and you just step over it. resultBaseObject = objArray.Append(object); } // ... } What you should do: void EffectorTestClass::CheckDirty(BaseObject *op, BaseDocument *doc) { // An error scope handler that brings the classic and maxon API together. iferr_scope_handler { // you could also write to one of the loggers here, e.g. ApplicationOutput("Error in CheckDirty() @", err); return false; } // ... if (op->GetDown() != nullptr) objArray.Append(op->GetDown()) iferr_return; // ... flags = data->GetFlags(doc, object); if ((flags & 1) == 1) { objArray.Append(object) iferr_return; } // ... }
  • Linkbox Dropdown Arrow

    c++ r20 r23
    9
    1
    0 Votes
    9 Posts
    1k Views
    LorenzJaegerL
    Hi, sorry for the late reply. Just got to test out your fix and everything works now. Thank you very much for your persistence! cheers, Lorenz
  • How to get renderer version number by python in C4D R19 ?

    4
    0 Votes
    4 Posts
    793 Views
    ferdinandF
    Hello @артём, without any further questions, we will consider this topic as solved by Monday, the 25th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Need help making this script

    4
    2
    0 Votes
    4 Posts
    625 Views
    ferdinandF
    Hello @rgi, without any further questions, we will consider this topic as solved by Monday, the 25th and flag it accordingly. Thank you for your understanding, Ferdinand
  • How to get a realpath of asset in c4d R19 by python ?

    4
    0 Votes
    4 Posts
    788 Views
    ferdinandF
    Hello @Артём, without any further questions, we will consider this topic as solved by Monday, the 25th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Drag and Drop Gradient Data onto a Gradient

    c++ r20 r21 r23 s22 s24 sdk
    5
    0 Votes
    5 Posts
    787 Views
    ferdinandF
    Hello @kbar, without any further questions, we will consider this topic as solved by Monday, the 25th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Setting node dirty does not trigger an update.

    r21 c++
    18
    0 Votes
    18 Posts
    2k Views
    ferdinandF
    Hello @Ogers, without any further questions, we will consider this topic as solved by Monday, the 25th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Arranging Objects by order of Object Manager

    python
    10
    0 Votes
    10 Posts
    2k Views
    ferdinandF
    Hello @orestiskon, without any further questions, we will consider this topic as solved by Monday, the 25th and flag it accordingly. Thank you for your understanding, Ferdinand
  • NodeData Undo

    r20 r19 r21 c++
    13
    0 Votes
    13 Posts
    2k Views
    ferdinandF
    Hello @C4DS, without any further questions, we will consider this topic as solved by Monday, the 25th and flag it accordingly. Thank you for your understanding, Ferdinand
  • How to Access the Values of GeDialog Gadgets

    s24 r25 python
    2
    0 Votes
    2 Posts
    449 Views
    ferdinandF
    Hello @mocoloco, thank you for reaching out to us. I have forked your question from How to Highlight a Button since it is a new question which does constitute a new topic. I am also currently on vacation which means that you will have to address the rest of the team to get support in a timely fashion (addressing just me and hiding your question in an older topic was probably what got your question being overlooked). About your question(s): You can find out more about dialog resources, i.e., defining a dialog in a file and not programmatically, in Resource Files Manual and Dialog Resource. Both manuals are part of our C++ documentation but do translate quite directly to Python since resource files are mostly a language agnostic topic. It also remains unclear to me if you actually want to define a dialog or a node since *"using .RES" does not distinguish the two. In either case the resource snippet I did post in the other thread could be used as a template for both cases. I am also not quite sure how the second part of your question is meant. You usually do react to dialog input events in GeDialog.Command. In a node you would have to indeed listen in NodeData.Message() as pointed out by yourself. In a dialog the value would be then attached to the dialog and in case of a node to the node. I.e., in the case of the muscle object thingy polling the quicktab gadget could look like this: Message(self, node, mid, mdata): """Polls a quicktab gadget for the hypothetical muscle object case. Args: node (c4d.BaseList2D): The node to which the message has been sent. mid (int): The message id. mdata (any): The message data. In case of description messages usually a `dict` in Python. """ # The conditioning to a specific message/event type is optional, but # should be in your case probably MSG_DESCRIPTION_POSTSETPARAMETER. if mid == c4d.MSG_DESCRIPTION_POSTSETPARAMETER: # Unpack from which element the message has been sent. eid = mdata["descid"][0].id # This has been sent by the quicktab gadget. if eid == c4d.ID_CA_MUSCLE_OBJECT_STATE: # Get the node state of the parameter which has that quicktab GUI # and do different things based on the state. state = node[c4d.ID_CA_MUSCLE_OBJECT_STATE] if state == c4d.ID_CA_MUSCLE_OBJECT_STATE_RELAX: # ... elif state == c4d.ID_CA_MUSCLE_OBJECT_STATE_COMPRESSED: # ... # ... return True For a more precise answer you should post code or a more precise description of what you are trying to do. And you should also address the rest of the team since I am still going to be on vacation for a few days. Cheers, Ferdinand
  • How to get Preferences folder path?

    s22 python
    3
    0 Votes
    3 Posts
    665 Views
    chuanzhenC
    @m_adam Great, thank you!
  • Save node created from resource editor as .json file

    s24 sdk c++
    3
    0 Votes
    3 Posts
    544 Views
    O
    That's what I was looking for, thanks a lot!
  • Spline generator drawing and selection override.

    6
    1
    0 Votes
    6 Posts
    1k Views
    WTools3DW
    I guess it is probably not doable with current api. I am marking this as solved! I sacrifice the possibility that the generator can be changed to a Spline object with the Cinema Make Editable command. If the call to NurbsData::GetContour() returns null, no highlighting or geometry will be drawn. So I can draw everything without any collisions. Only downside of this is that additional command for conversion of this object to a spline object is needed. Thanks.
  • How can i set custom Databases paths in prefs with python?

    python r21
    8
    1
    0 Votes
    8 Posts
    1k Views
    B
    Ok. I figured it out. The ID was wrong. It was supposed to be 465001634 -b
  • Loading Materials from AssetDescriptions into a Scene

    c++ r25
    3
    0 Votes
    3 Posts
    699 Views
    ferdinandF
    Hello @krfft, here the promised code. It is an extension of the Search Assets example which can be found in the Asset API Handbook. I hope this helps and cheers, Ferdinand The result: [image: 1633088569248-1.gif] The code: static Int32 g_max_materials = 10; /// ------------------------------------------------------------------------------------------------ /// Loads in the first ten material assets into the active document which can be found in the user /// prefs repository. /// /// I did remove most of the comment fluff here, assuming you are already familiar with the rest. /// ------------------------------------------------------------------------------------------------ maxon::Result<void> LoadAssets() { iferr_scope; // Get the active document and do some setup stuff to search for all materials in the user prefs // repository. See FindAssets() example function in the Assets API exmaples for details. BaseDocument* doc = GetActiveDocument(); if (doc == nullptr) return maxon::UnexpectedError(MAXON_SOURCE_LOCATION, "No active document."_s); const maxon::AssetRepositoryRef& repository = maxon::AssetInterface::GetUserPrefsRepository(); const maxon::AssetType assetType = maxon::AssetTypes::File(); const maxon::Id assetFindId = {}; const maxon::Id assetVersion = {}; maxon::BaseArray<maxon::AssetDescription> results; repository.FindAssets( assetType, assetFindId, assetVersion, maxon::ASSET_FIND_MODE::LATEST, results) iferr_return; // Iterate over the results until we have found ten materials. maxon::Int counter = 0; for (maxon::AssetDescription assetDescription : results) { if (counter == g_max_materials) break; maxon::AssetMetaData metadata = assetDescription.GetMetaData(); maxon::Id subTypeId = metadata.Get(maxon::ASSETMETADATA::SubType) iferr_return; // This is a material asset. if (subTypeId == maxon::ASSETMETADATA::SubType_ENUM_Material) { // With a valid url. maxon::Url url = assetDescription.GetUrl() iferr_return; if (url.IsEmpty()) continue; // The url of the asset is in case of material assets a c4d file. So, we merge that asset // document with the active document. ApplicationOutput("@| Type: @, Url: @", counter, subTypeId, url); maxon::String* error = {}; maxon::Bool didMerge = MergeDocument( doc, MaxonConvert(url), SCENEFILTER::MATERIALS, nullptr, error); ApplicationOutput("@: Merged: @, Error: @", counter, didMerge, error); if (didMerge) counter++; } } return maxon::OK; }
  • Mograph Effector List

    r20 sdk c++
    3
    0 Votes
    3 Posts
    714 Views
    J
    Thanks for the response. I figured it would need to be the SceneHook but always best to double check. John Terenece
  • Larger BaseMaterial Preview Renders

    c++ sdk
    7
    0 Votes
    7 Posts
    843 Views
    kbarK
    @m_magalhaes said in Larger BaseMaterial Preview Renders: The function looks like this. As you can see the progressRef and progressIndex are passed arguments. While BASEBITMAP_DATA_PROGRESSHOOK looks like you just need to pass a function (here a lambda), i still don't know what the context is good for. Sorry i don't have enough time to investigate more and give you a better answer. I will try to find more time this week. Be aware that this is marked as Private and "hack". So, it could change in the futur. Thanks. Looks like I was passing in the ProgressHook correctly but still for some reason I do not get any callbacks to it. Perhaps it is because I am not passing in an actual document filename, not sure. But I am still getting the correct renders back even though my ProgressHook does not get called, just would have been nice to see the progress on larger images. The context in this situation would have been great for me to let me set the progress in my progress dialog. So that is what it is useful for. It is fine that it is private and may change, I am only using this for internal tools to generate images, IE not a customer facing tool. Thanks for the help.