• 0 Votes
    3 Posts
    641 Views
    M
    Ok, thanks Ferdinand your clarification shed some light on my problem. I convert the version to a float which is the culprit ... import sys if sys.version_info < (3, 2): print("This Plugin requires at least Python 3.2") thank you
  • 0 Votes
    3 Posts
    672 Views
    ymoonY
    The mouse position is obtained as follows. msg[c4d.BFM_INPUT_X] --> GetEditorWindow() --> editor_x = win.Global2Local() --> mouse_x-abs(Editor_x) The problem of overlapping selection in GetNearestPoint() was solved by making a list of selected object. Thank you.
  • Setting mouse position

    Cinema 4D SDK
    4
    1
    0 Votes
    4 Posts
    766 Views
    WickedPW
    @i_mazlov thanks for posting the link to the icon resource page listing. Have bookmarked it. Thanks @ferdinand, I noticed the CSS change. It's made scrolling through what were large pages more digestible and quicker. Hopefully I haven't upset too many others. But appreciated from my end. Post edit: I know this topic was about setting the mouse position, but seems like that's an OS level thing for now. So have marked topic as solved.
  • Github Example group_nodes_r26 is broken.

    Cinema 4D SDK sdk python 2023
    4
    1
    0 Votes
    4 Posts
    492 Views
    ferdinandF
    Hello @Dunhou, I noticed maxon api changed every version and almost the major part of sdk change log We are aware that this fact is disliked by especially technical artists. But the Nodes API is still under active development and probably will be for the intermediate foreseeable future. Some changes from time to time are therefore inevitable. But we usually do not just remove something, but first mark it as deprecated and then remove it one or two cycles later, giving third parties more time to adapt. For S26, GraphModelInterface::IsSelected in graph.h changed for example into this: [[deprecated("Use GraphModelHelper static functions")]] MAXON_METHOD Result<Bool> IsSelected(const GraphNode& node); The problem is that this information is not visible at all for Python developers and still could also be improved for C++. We are aware of the problem, and working on the quality of change notes is something we already did over the last cycles and are still doing. Mapping such information to Python is certainly something I would like to do, but my main focus was for now gathering C++ API change notes in a more consistent manner. For now, I would recommend having an eye on the C++ change notes as a Python developer. The color coded deprecated markup should make it fairly easy to find upcoming removals, see for example the 2023.2 C++ API change notes. We are still working on improving API change notes for C++ and Python, because we are aware that it is crucial to clearly communicate our intentions with an API. I for example would like to make such information more searchable or pull it into the relevant documentary units. I.e., pull change notes also into the class, method, etc. descriptions, which are the subject of change. But that will be very hard to do with our current solutions might therefore have to wait a bit. Cheers, Ferdinand
  • How to get octane aov manager in python

    Moved General Talk python sdk
    7
    2
    0 Votes
    7 Posts
    2k Views
    ferdinandF
    Hello @render_exe, Thank you for reaching out to us. Unfortunately, as already pointed out by @Dunhou, questions about third party APIs are out of scope of support: Forum Guidelines: Scope of Support We cannot provide support on learning either C++, Python or one of its popular third party libraries. Thank you @Dunhou for providing such a nice community answer. Since this topic is not about the Cinema 4D SDK, I have moved it to General Talk. Cheers, Ferdinand
  • CUSTOMGUI_QUICKTAB trigger twice when click

    Cinema 4D SDK sdk python 2023 windows
    3
    0 Votes
    3 Posts
    417 Views
    DunhouD
    @m_adam Thanks man! this @dataclasses.dataclass decorator is pretty handy , new knowledge incoming And maybe some similar bug I have seen before , but I don't remember what it is (and even didn't know it is a bug or my bad coding ) , if I met some similar bugs I will update the topic , but now let's hope it will be fixed next release . Thanks for your help again Cheers~
  • How to obtain all vertices of an object in C++.

    Cinema 4D SDK s26 c++ sdk
    3
    0 Votes
    3 Posts
    596 Views
    P
    @m_adam Thanks
  • Inserting items into dropbox to TreeView

    Cinema 4D SDK
    4
    1
    0 Votes
    4 Posts
    707 Views
    M
    Hi @simonator420 for this purpose you have to define GetDropDownMenu and SetDropDownMenu. GetDropDownMenu is called by Cinema 4D to retrieve the content of the menu to display from the menuInfo dictionary. For more information about this dictionary please have a look at TreeViewDropDownMenuInfo Dict. SetDropDownMenu is called by Cinema 4D when the user select a value from the dropdown. Find bellow an implementation example: def GetDropDownMenu(self, root, userdata, obj: Entry, lColumn, menuInfo): menuInfo["entry"] = 1001 # Select teh second entry menuInfo["menu"][1000] = "First Entry" menuInfo["menu"][1001] = "Second Entry" menuInfo["menu"][1002] = "ThirdEntry" menuInfo["state"] = int(menuInfo["state"]) # Workaround to not have warning in Cinema 4D. Will be fixed in the next C4D version. def SetDropDownMenu(self, root, userdata, obj, lColumn, entry): print(f"User selected the entry with the ID: {entry}") Finally note that due to an issue that will be fixed in the upcoming version of Cinema 4D, even if you do not change the state, you need to override it to an int value otherwise it will print an error in the console (this is not blocking but still). Cheers, Maxime.
  • FieldLayer Plugin Globals

    Cinema 4D SDK r20 sdk c++
    3
    0 Votes
    3 Posts
    721 Views
    J
    Thanks for the response, that seems to have solved the problem.
  • Multi-menu menu, how to

    Cinema 4D SDK sdk c++
    5
    1
    0 Votes
    5 Posts
    1k Views
    WickedPW
    Thanks @ferdinand, Agree. I've avoided using OS-specific calls up until now. But for this one I've had to make an exception. Not an ideal solution, but it seems to work: [image: 1681381734409-e9057cac-086c-4810-bb9c-c198ecdc2427-image.png] To get around the lost window focus issue, I'm using the first dialog's Timer() to poll and check if any dialog in the menu has window focus. If none do, e.g., a user has clicked away, the system self-destructs. If a menu selection is made, it sends a Message() back to the calling object with details, and then self-destructs. It's all a bit of a hack. But it works. WP. Update: I'll mark this thread as solved. If I have any further questions I'll pop back in.
  • Check if object enabled

    Cineware SDK c++ sdk
    3
    1
    0 Votes
    3 Posts
    1k Views
    yesbirdY
    Hi, @ferdinand Many thanks for accurate and detailed response, ID_BASEOBJECT_GENERATOR_FLAG works like a charm ! .... YB
  • 2023.2.0 SDK and API Documentation Releases

    News & Information news sdk
    1
    0 Votes
    1 Posts
    5k Views
    No one has replied
  • 0 Votes
    4 Posts
    771 Views
    ferdinandF
    Hello @HerrMay, Is the multiplication of a matrix with a vector (mg.off = mg * p) essentially the same what mg * c4d.utils.MatrixMove(vec) does? No, mg * p multiplies a matrix by a vector which will yield the transformed vector p'. mg * c4d.utils.MatrixMove(vec) on the other hand multiplies two matrices, yielding the combined transform of them, a new matrix. What would be equivalent to mg * p is mg * c4d.utils.MatrixMove(p) * c4d.Vetcor(0, 0, 0). Please note that the whole subject is also out of scope of support as declared in the forum guidelines. I understand that the subject is a common barrier for the more on the artist-sided leaning users of ours, and I help where I can, but we cannot teach you vector math, linear algebra, or however you want to label this subject. Find below a short code example. Cheers, Ferdinand Output: M = Matrix(v1: (1, 0, 0); v2: (0, 1, 0); v3: (0, 0, 1); off: (0, 100, 0)) p = Vector(100, 0, 0) M * p = Vector(100, 100, 0) M * c4d.utils.MatrixMove(c4d.Vector(100, 0, 0)) = Matrix(v1: (1, 0, 0); v2: (0, 1, 0); v3: (0, 0, 1); off: (100, 100, 0)) M * c4d.Vector(100, 0, 0) = Vector(100, 100, 0) N * c4d.Vector( 0, 0, 0) = Vector(100, 100, 0) M * c4d.utils.MatrixMove(p) * c4d.Vector(0, 0, 0) = Vector(100, 100, 0) Code: import c4d # Let us assume #M to be the global matrix/transform of some object #op. View it as a tool to # transform a point in global space into the local coordinate system of #op. M: c4d.Matrix = c4d.Matrix(off=c4d.Vector(0, 100, 0)) # The matrix #M now has this form: # # | v1 1 0 0 | # The "x-axis" of the coordinate system defined by #M. # | v2 0 1 0 | # The "y-axis" of the coordinate system defined by #M. # | v3 0 0 1 | # The "z-axis" of the coordinate system defined by #M. # ---------------------- # | off 0 100 0 | # The origin of the coordinate system defined by #M. # # I.e., #M has the standard orientation and scale and only translates all things by 100 units # on the y-axis. So, the object #op would have the Euler angles (0°, 0°, 0°), the scale (1, 1, 1) # and the position (0, 100, 0) in world coordinates. # Define a vector #p to transform and print both #M and #p. p: c4d.Vector = c4d.Vector(100, 0, 0) print(f"{M = }") print(f"{p = }") # Transforming a point #p by a matrix #M will yield a point #q that is in the same relation to #M # as #p is to the global frame. q: c4d.Vector = M * p # #q will be the vector (100, 100, 0) because , (100, 100, 0) and #M are the same relation as #p # and the identity matrix are, a.k.a., the world frame. In a less technical way, (0, 100, 0) is the # origin of the coordinate system defined by #M. And to express #p in a manner as if #M would be # its coordinate system, we have to add (0, 100, 0), because that is the new origin. For orientation # and scale it works more or less the same, I would recommend having a look at the Matrix manual or # Wikipedia article on the subject. print (f"{M * p = }") # We can construct new transforms in many ways (again, Matrix Manual :)), one of them is by # combining multiple transforms via matrix multiplication. # We "add" the translation transform (100, 0, 0) to #M. Note that matrix multiplication is not # commutative, i.e., "M * N = N * M" does not always hold true. In this case it would because only # translations are involved. N: c4d.Matrix = M * c4d.utils.MatrixMove(c4d.Vector(100, 0, 0)) print(f"{M * c4d.utils.MatrixMove(c4d.Vector(100, 0, 0)) = }") # To get the same point as #q when multiplying a point #r with #N, we must pick the null-vector # because the origin of #N is already at where M * (100, 0, 0) is. print (f"{M * c4d.Vector(100, 0, 0) = }") print (f"{N * c4d.Vector( 0, 0, 0) = }") # We can also do it in one operation: print (f"{M * c4d.utils.MatrixMove(p) * c4d.Vector(0, 0, 0) = }")
  • 0 Votes
    4 Posts
    668 Views
    M
    Hello @HerrMay, without further questions or postings, we will consider this topic as solved by Monday 05/06/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • 0 Votes
    3 Posts
    475 Views
    M
    Hello @jpheneger, without further questions or postings, we will consider this topic as solved by Monday 05/06/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • 0 Votes
    3 Posts
    653 Views
    H
    Hi @m_adam, thanks for the explanation and your example code. That will absolutely suffice my needs. Good to know though that additional information may be available in the future. Cheers, Sebastian
  • 0 Votes
    3 Posts
    1k Views
    H
    Hello @ferdinand, alright I see. I already thought that you would teach me once again that the naive thought I put up here would'nt hold up to the real world. Thanks for the explanation and the example you provided. I guess that will do just fine. As always much appreciated! Cheers, Sebastian
  • FieldList Enable Clamping

    Cinema 4D SDK r20 sdk c++
    5
    0 Votes
    5 Posts
    1k Views
    J
    Thanks, that was exactly what I was looking for. John Terenece
  • 0 Votes
    3 Posts
    628 Views
    yesbirdY
    Thanks, @Manuel. The reason was in definition of TAG_MULTIPLE at the moment of registration. Now the tag properties are displayed as I was expecting. .... YB
  • Quicktab SDK Example

    Cinema 4D SDK r20 2023 python sdk
    9
    1
    0 Votes
    9 Posts
    2k Views
    M
    While rethinking about it last night, it may not be that slow if on user interaction you just flush the main group and re-attach already existing dialog. So you need to modify your `def _DrawQuickTabGroup(self)`` method like so to only display visible dialog: def _DrawQuickTabGroup(self, onlyVisible=True): """ Creates and draws all the SubDialog for each tab, take care it does not hide these according to a selection state. Returns: True if success otherwise False. """ # Checks if the quicktab is defined if self._quickTab is None: return False activeIds, activeNames = self.GetActiveTabs() # Flush the content of the group that holds all ours SubDialogs self.LayoutFlushGroup(ID_MAINGROUP) #self.GroupBorderSpace(left=5, top=5, right=5, bottom=5) # Iterates over the number of tab to create and attach the correct SubDialog for tabId, (tabName, tabGui) in enumerate(self._tabList.items()): toDisplay = tabId in activeIds if not toDisplay: continue self.AddSubDialog(ID_QUICKTAB_BASE_GROUP + tabId, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 0, 0) self.AttachSubDialog(tabGui, ID_QUICKTAB_BASE_GROUP + tabId) self.LayoutChanged(ID_MAINGROUP) return True Then in the Command message instead of calling DisplayCorrectGroup you should call _DrawQuickTabGroup like so: def Command(self, id, msg): if id == ID_QUICKTAB_BAR and self._quickTab: self._DrawQuickTabGroup() return True Regarding your question and classic Tab, find an example in Remove a GeDialog Tab Group but as you can see this is also not possible to remove a tab without redrawing everything . Cheers, Maxime.