• How to detect a document switching?

    python r23 s24 sdk
    5
    0 Votes
    5 Posts
    877 Views
    ferdinandF
    Hello @mocoloco, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Apply Substance Preset with no User Input.

    Moved
    5
    0 Votes
    5 Posts
    685 Views
    ferdinandF
    Hello @janine-mcmaster, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Add button to run a script

    12
    0 Votes
    12 Posts
    2k Views
    ferdinandF
    Hello @stereo_stan, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • MoData Rotations

    5
    0 Votes
    5 Posts
    783 Views
    ferdinandF
    Hello @RenatoT, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Detect Menu/Manager while hovering...

    python maxon api classic api
    4
    1
    0 Votes
    4 Posts
    976 Views
    ferdinandF
    Hello @lasselauch, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Where to find .res documentation?

    3
    0 Votes
    3 Posts
    569 Views
    orestiskonO
    @m_magalhaes Thanks Manuel!
  • 0 Votes
    7 Posts
    759 Views
    ThomasBT
    @m_magalhaes yes thanks that was my idea, too , I created a temporary object, in my case a spline with 0 points and 0 segments and simply exchanged it, thanks.....
  • Python: possible to check if a description is highlighted in AO?

    Moved
    3
    1
    0 Votes
    3 Posts
    532 Views
    R
    thanks.
  • 0 Votes
    5 Posts
    511 Views
    chuanzhenC
    @m_adam Thanks
  • Get string value from long cycle.

    c++ r21
    3
    0 Votes
    3 Posts
    643 Views
    O
    I came up with this solution which is working fine. Thanks for your help. std::string getDropDownName(Description* const description, Int32 group_id, Int32 SelectedItem) { const DescID* singleid = description->GetSingleDescID(); const DescID cid = DescLevel(group_id, DTYPE_LONG, 0); std::string selected_name = ""; if (!singleid || cid.IsPartOf(*singleid, nullptr)) { AutoAlloc<AtomArray> arr; BaseContainer* selectionParameter = description->GetParameterI(DescLevel(group_id, DTYPE_LONG, 0), arr); if (selectionParameter != nullptr) { BaseContainer* items = selectionParameter->GetContainerInstance(DESC_CYCLE); if (items != nullptr) { selected_name = items->GetData(SelectedItem).GetString().GetCStringCopy(); } } } return selected_name; }
  • 0 Votes
    3 Posts
    792 Views
    J
    @m_magalhaes This worked great, thank you.
  • Trigger Autosave

    python
    3
    0 Votes
    3 Posts
    486 Views
    H
    Hi Ferdinand, No worries! Thanks for the reply, it was very helpful as a starting point. I ended up using the c4d.GetWorldContainerInstance() and then c4d.WPREF_AUTOSAVE_DEST_PATH to get the custom filepath and then just a SaveDocument with the AUTOSAVE flag seems to be doing the trick. thanks again!
  • Faster way of converting dict of Vector3 to Vector4

    python
    3
    0 Votes
    3 Posts
    662 Views
    orestiskonO
    @m_adam Thanks a lot for the benchmarking Maxime. I was planning to go for the string method, I'm surprised it's not faster. I wasn't planning to use this for a plugin, not to mention C++, but it's good information to have.
  • update background color of bitmap button and static text

    2
    0 Votes
    2 Posts
    424 Views
    ManuelM
    Hi, it's not possible to change the backgrounds of those gadgets. For the button, you can instead add a BitmapButton and change the image to display the color you want just like in this thread Cheers, Manuel
  • MoData Effector Rotation

    r20 c++ sdk
    8
    1
    0 Votes
    8 Posts
    2k Views
    ferdinandF
    Hello @johnterenece, so, to clarify this for myself. You have an ObjectData implementation which probably overwrites GetContour, i.e., builds a SplineObject , or draws spline-like information into the viewport. This plugin then has an InExcludeData parameter which is populated with Mograph effectors which are then meant to influence the vertices of your plugin. Consequently you want to do the deformation of your input geometry yourself and not like I assumed before not just clone stuff onto a PolygonObject that has been deformed by a PolyFx. First of all, I do not see really the point in reinventing the wheel in the first place, why not use PolyFX if it does what you need anyways? I would also stress that this cobling up of functionalties, deformation and generation in your case, in a single plugin and even single function in your case, is often not a very good idea, bot for technical and debugging reasons. As I said before, we cannot debug your code for you, but here are some points: The way you use a MoData tag is not its intended usage, the tag is reserved for MoGraph generators only and you hijacking it here is something you have to do on your own responsiblity. You also do not take the transforms of the effectors into account which might be a cause for your problem. There are other problems like using BaseObject::MakeTag and a possibly thread environment and the lack of error handling with maxon::BaseArray::Append which can lead to crashes, as you just store posible erros in resultVector and resultVector2D in your code which are undefined, but I assume to be of type maxon::Result<Vector> and maxon::Result<maxon:BaseArray<Vector>. But they are not the source of your problem, which likely lies in the fact that you do hijack MoData in the way you do and then do not respect the transforms of the effectors. You still have not told us the plugin type you are implementing, but if it is a ObjectData which generates a spline, I would simply build the spline on the orginal polygon geometry and then retun the spline with a PolyFX attached to it in GetContour. Much easier than reinventing the wheel here. You would have to pass through the content of the InExcludeData of your plugin to the PolyFX. Cheers, Ferdinand
  • 0 Votes
    8 Posts
    1k Views
    ManuelM
    Hi, I'm happy that you solved your issue. For your next post, and i know you can see that as a waste of time, please follow our guidelines. Use the functionalities of the forum to mark your thread as a question, and mark it as solved when it's done. (Even for a negative answer). Please use also tags, that help us to understand and answer faster without guessing. Language you are using (python, c++) cinema4D version, everything that can help us to understand your issue. You will also find on those guidelines how to explain your issue. Sometimes people want a solution for an issue creating by a bad workflow. In your case, it looks more like sharing information between plugins. There are several answers/possibilities for that. This forum is also about stepping back, having a fresh eye on your issue and move forward Cheers, Manuel
  • R20 and R24 Description Differences

    8
    0 Votes
    8 Posts
    1k Views
    D
    @m_adam Hi! Thanks for looking into it!
  • How to hide or disable user data description elements

    python s24 windows macos
    2
    1
    0 Votes
    2 Posts
    511 Views
    ferdinandF
    Hello @thomasb, thank you for reaching out to us. Please remember to open a new thread for new questions of yours. It is fine to ask follow-up questions in a topic, but when the threshold to a new topic is being crossed, a new thread should be opened. I have done this for you here. In principle this is at least partially possible. You can determine the visibility for a user data description element with the description field DESC_HIDE, see example at the end of the posting for details. It is not possible to gray-out, i.e., disable, user data description elements. It is also a bit a case of an unusual workflow for user data, since you would have to rebuild the user data container every time you want to hide or show and element in it. You could overwrite for example message() in a Python scripting tag and then react to when a user clicks a button, drags a slider, etc. in the user data and rebuild the user data based on that. Which would give you the dynamic GUI feeling you are probably after. I have done this in the past, but more as a hack for fun to see how far I can push user data. I would not recommend doing it as it will complicate things like animation and can lead to "janky" interfaces. Being bound to the execution order of expressions can also lead to problems. If you want dynamic GUIs, you should implement a plugin. There you can overwrite NodeData.GetDDescription() to modify the description, e.g., add, remove, or hide stuff. To disable stuff, i.e., gray it out, you must overwrite NodeData.GetDEnabling(). Cheers, Ferdinand """Example for adding a hidden user data element. """ import c4d def main(): """Adds a hidden check box and a visible integer element to the user data of the selected object. """ if op is None: raise ArgumentError("Please select an object for running this script.") datenDesc = c4d.GetCustomDataTypeDefault(c4d.DTYPE_BOOL) datenDesc[c4d.DESC_NAME] = "Daten" datenDesc[c4d.DESC_HIDE] = True # Element will be hidden stepsDesc = c4d.GetCustomDataTypeDefault(c4d.DTYPE_LONG) stepsDesc[c4d.DESC_NAME] = "steps" stepsDesc[c4d.DESC_HIDE] = False # Element will be visible op.AddUserData(datenDesc) op.AddUserData(stepsDesc) c4d.EventAdd() if __name__ == '__main__': main()
  • Python plugin and Linux CLR arguments

    python s24 r23
    5
    0 Votes
    5 Posts
    796 Views
    V
    Hello, Adding the path to the plugin in g_additionalModulePath fixed the issue. Thank you very much for your help.
  • How to add a Userdata child to a group via script

    8
    0 Votes
    8 Posts
    2k Views
    ferdinandF
    Hello @thomasb, @thomasb said: I prefer to use this notation.......it is ok or? motherDescId=c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA,c4d.DTYPE_SUBCONTAINER,0),c4d.DescLevel(1,c4d.DTYPE_GROUP, 0)) Yes, that is okay. In fact, this most verbose form is the only form which is guaranteed to always to be sufficient when addressing a description element. But as stated earlier, the instances where that verbose form is required are quite rare; modifying a description like discussed here and addressing c4d.modules.graphview ports are in fact the only instances I can think of out of my head in the Python SDK. I personally would always gravitate towards the shorthand form, i.e., myNode[c4d.ID_USERDATA, 1] in this case, wherever possible, as the verbose form is a bit confusing to read. Cheers, Ferdinand