• 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
    464 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
    670 Views
    chuanzhenC
    @m_adam Great, thank you!
  • Save node created from resource editor as .json file

    s24 sdk c++
    3
    0 Votes
    3 Posts
    576 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
    706 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
    747 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
    845 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.
  • How to import svg in S25 from path

    Moved python
    3
    0 Votes
    3 Posts
    906 Views
    I
    Thank you so much!
  • Best practices for a plugin containing multiple commands

    python
    4
    0 Votes
    4 Posts
    932 Views
    H
    Wow, thank you both for such detailed and informative replies! First of all, apologies @ferdinand for the tag issues, I was consulting the guidelines whilst typing my question but managed to miss the OS tag. Not sure if it matters too much for python dev, but I am on a Windows machine. I did however notice that the tag list doesn't seem to be updated to include R25 just yet (the version I'm currently working with), so it may need adding by the team. It doesn't look like I'm able to edit my original post past a certain time, but if you have the ability feel free to update Useful to know about the distinction between CommandData.ExecuteOptionID() and CommandData.ExecuteSubID(). The cogwheel icon present on some of the in-built commands was something that I'd noticed previously and been curious as to the implementation of - assumed it was just some complex code magic that added an additional button to the menu UI, ha! I guess that you're probably right in that I shouldn't try to run before I can walk, and if there's no limit to the amount of plugin IDs permitted (makes sense if there are hundreds of thousands of them going spare! ), then the keep-it-simple approach of registering multiple IDs would probably be best at this stage. For future reference though, if it is functionally the same as registering multiple IDs, do you know of any resources showing the implementation of CommandData.ExecuteSubID(), besides the docs; is this something that could be a candidate for an additional example in the SDK plugins repo? @Cairyn thanks for offering a more general insight into the situational decisions behind why something might be the 'best' choice (or not a choice at all!). I'm a designer first and foremost with an interest in coding, rather than the other way around, so considering the UX of a potential plugin and how it could fit into my own workflow is something I'm keen not to ignore To be a little more specific about how the plugin will function: essentially it will be a set of commands allowing the user to rapidly navigate around the viewport in a way that's a bit more custom than the default 'front, back, left, right, etc' views, as well as the ability to toggle between perspective and parallel views, ideally while keeping the same projection matrix (the hard bit!). My intention is to bind these commands to separate shortcuts so that they're a 'function at your fingertips' Actually I do have some additional questions about the ability to set keyboard shortcuts via a plugin, instead of the command manager, and how Cinema then deals with shortcut conflicts, but I think that's one for another thread! Definitely going to refer back to these suggestions as I continue my learning journey. Thank you both again!
  • Run command, after c4d fully loaded...

    5
    0 Votes
    5 Posts
    1k Views
    ymoonY
    Thank you.. It's Solved. @fwilleke80 @ferdinand and @kbar def PluginMessage(_id, data): if _id == c4d.C4DPL_PROGRAM_STARTED:
  • How to Register "Hot key" plugin in python?

    python r23
    5
    2
    0 Votes
    5 Posts
    1k Views
    gheyretG
    Hi @ferdinand , Thank you very much for your detailed reply. I think it is very helpful to me. Cheers!
  • R25 doesn't register the [c4d.ID_BASEOBJECT_COLOR] parameter

    Moved
    3
    1
    0 Votes
    3 Posts
    532 Views
    R
    @m_adam OK this is really weird. I tried this over and over yesterday for several hours. this morning it is working fine! It must have been a case of restarting my machine or something. All set on my end! Thanks for testing either way, much appreciated!
  • What's really happening inside a CKey?

    c++ python r23
    10
    0 Votes
    10 Posts
    2k Views
    CairynC
    DTYPE_LONG can be used with SetGeData if the track category is CTRACK_CATEGORY_DATA, see the third post in this thread. This is the only ambiguous datatype at the moment, and as other datatypes wouldn't make sense with SetValue I think it will remain the only one. But I do claim that the category of the track determines whether you need to use SetValue or SetGeData. (That is almost the same in effect... but in case of DTYPE_LONG not quite.)
  • Best way to store "Bake" Information

    3
    0 Votes
    3 Posts
    571 Views
    D
    Hi Manuel, I didn't think about CopyTo being called on undo. That might be all I need then, thanks. I did a couple tweaks and as of now everything is perfect. Dan
  • R25 Json Parser Usage

    3
    0 Votes
    3 Posts
    655 Views
    Danchyg1337D
    @m_magalhaes Thank you!
  • Vector.__xor__(self, other) error in documentation

    Moved python
    3
    1
    1 Votes
    3 Posts
    468 Views
    ferdinandF
    Hello @SteveJLV, the example has been fixed and both computations now will reflect the correct result. The fixed example will be included with an upcoming release of the Python SDK documentation. Cheers, Ferdinand