• 0 Votes
    6 Posts
    2k Views
    r_giganteR
    Hi Shir, thanks for following up and providing your additional info. Showing parameter in the Attribute Manager or a custom icon in the Object Manager is not such a big issue: you can start looking at Py-RoundedTube which is an ObjectData derived plugin where all such a stuff (and more) is shown. That said, the real question is instead to understand what your rig is actually doing and see if it's reasonable to implement the Xpresso functionality from a set of "primitive" functions you implement in your plugin or if would be instead easier to programmatically recreate the Xpresso rig in an XpressoTag then attached to the object generated by your plugin. Actually this assessment can't be done from here where the final functionality and the complexity of your Xpresso network is unknown. So far I do see three approches: start on your own, step-by-step, dissect the code from the example I mentioned above and try to move your steps alone outsource the task to some paid developer or call for volunteers in our very helpful PluginCafe community. I'm sorry not be more helpful but, as said in the first post, we can't deliver turn-key plugins or scripts but rather help our customer to learn from our resources. Best, Riccardo
  • how to insert a gradiet with step interperation?

    Cinema 4D SDK python r20
    3
    0 Votes
    3 Posts
    972 Views
    M
    yeah! I got it! Thank you very much!
  • ColorDialog Flags

    Cinema 4D SDK python
    2
    0 Votes
    2 Posts
    639 Views
    S
    Hello, ColorDialog is just the Python version of C++'s GeChooseColor() function. It uses the flags DR_COLORFIELD_ICC_BASEDOC and DR_COLORFIELD_ICC_BPTEX which just define the proper color profile. Typically is is enough to just set 0. best wishes, Sebastian
  • Phong Break Selection

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    1k Views
    M
    Hi @merkvilson, this is a limitation actually the tool Phong Break selection and the modeling command MCOMMAND_PHONGTOSELECTION are two completely separate things. So the only solution available to you is to manually break the Phong. I'm sorry we can't help you more on that, Donovan points you to the correct direction with the neighbor class. Cheers, Maxime.
  • Spline notRealOffset to RealOffset

    Cinema 4D SDK
    6
    0 Votes
    6 Posts
    2k Views
    r_giganteR
    Hi rownn, thanks for following up. Can you elaborate more on I wasnt able to get the "customlength" by offset.? Actually looking at your screenshot and assuming that the red-labelled refers to what you actually consider "wrong" and the green-labelled to the right, I think that the red-labelled is indeed correct since it actually lies in the middle of spline considering that the start point is the top/right vertex. At the same time, the green-labelled point is the one that you can obtain when passing 0.5 to SplineHelp::GetPosition() which is the 50% of the spline parametrization not of the spline length. Assuming a linear rectangle is used as shown above the code below shows the behavior I describe: def main(): sh = c4d.utils.SplineHelp() sh.InitSpline(op) splineLength = sh.GetSplineLength() halfLength = splineLength / 2 midPointOffsetIncorrect = halfLength / splineLength midPointOffsetFromReal = sh.GetOffsetFromReal(midPointOffsetIncorrect,0) midPointOffsetFromUnit = sh.GetOffsetFromUnit(halfLength,0) mtx = c4d.Matrix() midpointRed = sh.GetPosition(midPointOffsetFromUnit) # which in this case is the same of offsetFromReal midNullRed = c4d.BaseObject(c4d.Onull) midNullRed[c4d.ID_BASEOBJECT_USECOLOR] = 2 midNullRed[c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(1,0,0) midNullRed[c4d.ID_BASELIST_NAME] = "MidRed" mtx.off = midpointRed midNullRed.SetMg(mtx) midpointGreen = sh.GetPosition(midPointOffsetIncorrect) midNullGreen = c4d.BaseObject(c4d.Onull) midNullGreen[c4d.ID_BASEOBJECT_USECOLOR] = 2 midNullGreen[c4d.ID_BASEOBJECT_COLOR] = c4d.Vector(0,1,0) midNullGreen[c4d.ID_BASELIST_NAME] = "MidGreen" mtx.off = midpointGreen midNullGreen.SetMg(mtx) doc.InsertObject(midNullRed) doc.InsertObject(midNullGreen) c4d.EventAdd() Best, Riccardo
  • r20 python Field

    Moved Cinema 4D SDK r20 python
    3
    0 Votes
    3 Posts
    736 Views
    M
    Hi @Nenov, first of all, welcome in the plugincafe community. No worry since it's your first post, but I would like to point you to the Q&A Functionality and How to Post Questions especially about categories. I've setup your topic correctly and moved to the correct category. Regarding your issue, this actually the purpose of the example to do a different operation on even and odd clones. With that's said you can find more example in our Github repository especially theses following files: field_python_color_direction.c4d field_pythonmodifier_readcolor.c4d field_pythonmodifier_vertexmap.c4d If you have any question please let me know, Cheers, Maxime.
  • SaveDocument() file name character limit?

    Cinema 4D SDK python windows r19
    3
    0 Votes
    3 Posts
    819 Views
    .
    Problem was with the total path length versus the file name length. 256 characters for the entire path and filename.
  • Get clone of group and keep links

    Moved Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    1k Views
    R
    Very cool, thx alot Sebastian rownn
  • Run Plugin Last

    Cinema 4D SDK python r19
    3
    1
    0 Votes
    3 Posts
    905 Views
    A
    @m_adam Hi Maxime, It works like a treat! I've ended up changing the UI to a treeView and it's still working great. Thank you very much! Andre
  • MCOMMAND_JOIN issue

    Cinema 4D SDK python
    10
    0 Votes
    10 Posts
    3k Views
    a_blockA
    Hi, thanks for pointing out this issue. We'll see if can get a fix for that (not all tags visible, if zooming in with browser). In the end Maxime wasn't referring to tags at all. Instead he was talking about the Q&A Function we have in this forum. I took the freedom to mark this thread as solved (see this shiny green stamp next to the headline ). Cheers, Andreas
  • Seperators in GetSubContainer

    Cinema 4D SDK python windows r20
    2
    1
    0 Votes
    2 Posts
    540 Views
    M
    Hi @Boony2000 In a GetSubContainer, to insert a separator use InsData(0, "") The ID used should always be 0. As described in ShowPopupDialog Example. Which give us def GetSubContainer(self, doc, submenu) : menuItems = [["name1"], ["name2", "hasIcon"], ["name3"]] for i, data in enumerate(menuItems) : if len(data) > 1: submenu.SetString(i+1000, data[0] + "&i" + str(c4d.IDM_KEY_NEXT) + "&") submenu.InsData(0, "") else: submenu.SetString(i+1000, data[0]) return True Cheers, Maxime.
  • INCLUDE user-defined res files

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    1k Views
    a_blockA
    Hi, no, you are not! Really there are no stupid questions and please do not delete such posts. Especially not, if you already invested time in posting the correct answer. We'd rather see this as knowledge others might benefit from in the future. Cheers, Andreas
  • 3D Mouse Slider Focus

    Cinema 4D SDK python windows r19 maxon api
    13
    1
    0 Votes
    13 Posts
    4k Views
    CairynC
    @charly CollieMouse rotates around the current selection or the explicit rotation center (the one you set with the INS shortcut). It will not rotate around the mouse pointer (I think... I implemented so many modes over time that I tend to forget the options...). The mouse pointer only exists in 2D space anyway so the actual rotation would happen around a projection of the mouse position into the scene, and if you move the mouse, the rotational center would change... not sure whether that is even a usable mode. The mode I'd recommend would be around the explicit center: Position the mouse, press INS (or whatever shortcut you use), and then use the 3D mouse to rotate around that. C4D shows the explicit center as green cross so you always know where it is. At the moment there is no R2023 version of CollieMouse anyway, so the point is moot. But you can reach me under cairyn (at) tigress (dot) com if you require specialty development.
  • Adding icon to submenu

    Cinema 4D SDK python windows r20
    7
    1
    0 Votes
    7 Posts
    2k Views
    B
    Thanks, Maxime! I will use that in the meantime. Edit: Why can't I flag your posts as the correct answer? I can only flag my own.
  • 0 Votes
    4 Posts
    877 Views
    a_blockA
    Yes, that's appropriate. Thanks
  • 0 Votes
    6 Posts
    1k Views
    fwilleke80F
    Hi Maxime, now that's interesting. You code runs perfectly fine. If I copy & paste your dialog code into my script, it still works, though your dialog is seemingly similar to mine. So, I have no idea what fixed it, but it did. Maybe some excess trailing spaces somewhere? Weird... but thank you for doing your magic If I ever find out what was happening here, I'll post here. Cheers, Frank
  • Polygon selection order

    Cinema 4D SDK python r20
    2
    0 Votes
    2 Posts
    674 Views
    r_giganteR
    Hi Pim, thanks for reaching us. With regard to your question, I confirm that there's no option to get the order of the selected polygons nor the interaction tag can help in this direction. Best, Riccardo
  • GeDialog in a Python Script does not work

    Cinema 4D SDK r20 python
    3
    1
    0 Votes
    3 Posts
    903 Views
    fwilleke80F
    Aaah, ok, thanks! I browsed a couple of examples here in the forum, and always saw them return True. Should've known better Cheers, Frank
  • GetCache() bug

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    1k Views
    M
    Hi @merkvilson, this feedback has been communicated to our development team. Cheers, Maxime.
  • Struggling with Python Documentation and pyc4d

    Cinema 4D SDK python r20
    3
    0 Votes
    3 Posts
    1k Views
    M
    Hi @sungam, first of all, welcome in the plugincafe community and thanks a lot for your feedback. I know these words will not help you but we are currently working to improve our Python Documentation and examples as well. With that's said, I know documentation should be sufficient, but MAXON offers free support for developers at plugincafe. So please contact us when you are in trouble, don't know where to look at or even get SDK issue. res folder is a specific folder where resources needed for your plugin are stored. (e.g. you develop an ObjectData plugin(a new object, like a cube), this cube get a description (a set of parameters, which make a description of the actual object representation), so you need to define theses descriptions within the res folder. Same thing for string and so on...). Clion is actually a C++ IDE, JetBrains offer Pycharm which is also supported by c4dpy. See C4DPY manual we cover how to setup Pycharm with c4dpy. "EnvironmentError: cannot find pyp file - plugin registration failed". I'm not sure to understand this, this error comes from c4dpy? Is it possible to get your current plugin, at least the code of your pyp file? If you have any questions, please open a new thread, in plugincafe we prefer to have one topic per thread so we can focus only into this specific issue and don't screw conversation, it's also easier for other peoples to find information. Do not hesitate to explain to us your project, so we can guide you (help us, to help you ). If it's something you don't want to disclose you can always reach us at [email protected]. Cheers, Maxime.