• Stacking Tabs Menu?

    Cinema 4D SDK r21 python
    7
    0 Votes
    7 Posts
    874 Views
    B
    @r_gigante Thanks for the response. RE: Extending to get it working for more than one should be trivial. Unfortunately, the whole code is trivial to me being novice. Anyhow, I guess I'll just learn on QuickTabCustomGui on a separate thread. RE: With regard to the "stacked" tabs functionality, as said above Yes, you did. I was wondering if there is an option for the TabGroupBegin as that is somewhat straight forward to me rather than the QuickTabCustomGui. So I guess, this confirms that it is not possible for the TabGroupBegin. Again, no further action required. Will just open another thread for the QuickTabCustomGui.
  • Tips for GeDialog GUI ID Management?

    General Talk r21 python
    4
    0 Votes
    4 Posts
    784 Views
    B
    Thanks for the response @mp5gosu Yea, this "another level of abstraction" might bite me in other sections of the code but this is the only way I can be sane for now. hehe @m_adam RE: it's also advised to use only iD superior to 1000. Thanks for the note. RE:here is one of the few possible ways The code works as expected. Thanks again! Should make things easier now
  • 0 Votes
    13 Posts
    3k Views
    M
    SaveDocument is already present in the original code in the extended threading class "ExportThread" TO not make it happens in a thread. So to directly execute it in ExecuteConversion. The use of SendCoreMessage is a way, from a thread (and it's the case for you in ExportThread::Main) to send a message, that Cinema 4D will process on the Main thread (I didn't use in my code because in my case I'm in the main thread). So you can react to this message and do something (in your case SaveDocument). It was just for your information, regarding what's your thread is doing (only calling SaveDocument) I would say that using a thread here make no sense, and you should directly call SaveDocument in your ExecuteConversion function. Hope it's more clear. Cheers, Maxime.
  • Update GeDialog When Button is Pressed?

    Cinema 4D SDK r21 python
    6
    0 Votes
    6 Posts
    736 Views
    B
    RE: So if it recreates the same things it is probably because images are not local to your class but only to your function, Ah, gotcha. Thanks for the heads up. Works now as expected
  • Simple way to save images?

    Cinema 4D SDK r21 python
    5
    0 Votes
    5 Posts
    614 Views
    M
    @bentraje said in Simple way to save images?: Union This means it can be either a str or either a c4d.storage.MemoryFileStruct. (Both don't really make sense). Cheers, Maxime.
  • Modify Preferences of an Third Party Plug-in?

    Cinema 4D SDK r21 python
    3
    0 Votes
    3 Posts
    367 Views
    B
    Hi @zipit Thanks for the response. The thread reference works as expected. Here is the code I used: op = plugins.FindPlugin(1027974) # Retrieved from the script log if op: print op[c4d.XPPREFS_SYSHUD_SHOW] # we know the enum from the console Have a great day ahead!
  • Drag & Drop to Reorder in GUI

    Cinema 4D SDK python
    14
    0 Votes
    14 Posts
    2k Views
    ?
    @m_adam Terrific work, Maxime! This is very helpful to me and I'm sure the many others who want to learn about dragging in Cinema 4D's UI. Excellent job!
  • GUI Layout Issues

    Cinema 4D SDK python sdk
    4
    2
    0 Votes
    4 Posts
    656 Views
    ?
    @m_adam You are a legend! I've learned a lot about UI in Cinema 4D from this post, thank you very much.
  • Insert object in Treeview

    Cinema 4D SDK r20 python
    4
    0 Votes
    4 Posts
    1k Views
    P
    Thanks, great explanation! One small issue. Delete doesn't work because objParent' is not defined. Traceback (most recent call last): File "scriptmanager", line 251, in DeletePressed NameError: global name 'objParent' is not defined Here the code that, I think, solves the issue: def DeletePressed(self, root, userdata): "Called when a delete event is received." for tex in reversed(list(TextureObjectIterator(self.listOfTexture))): if tex.IsSelected: objParent = tex.GetParent() # Added listToRemove = objParent.GetChildren() if objParent is not None else self.listOfTexture listToRemove.remove(tex)
  • 0 Votes
    10 Posts
    2k Views
    B
    @m_magalhaes RE: Does using the object list iterator is mandatory or not ? For this one, it kinda is since the whole code base rest on the for loop section. RE: you can see in this file that i can use UserData Thanks for the clarification. I see what you mean now. It works on my use case. Have a great day ahead!
  • Execution Delay When Reading Data from JSON file

    Cinema 4D SDK r21 python
    6
    0 Votes
    6 Posts
    886 Views
    M
    I don't have a lot to add here, @zipit almost pointed everything moreover doing proper profiling for hard drive can be a bit tricky to set up for couple of reasons: Another process may randomly use hard drive (e.g Antivirus checking). Cached file optimization made by either the OS, the processor or even the hard drive itself. Cheers, Maxime.
  • Unexpected Margin/Padding on AddCustomGui

    Cinema 4D SDK r21 python
    12
    0 Votes
    12 Posts
    1k Views
    B
    You are right. self.width = c4d.gui.SizePix(w) self.height = c4d.gui.SizePix(h) self.color = color wasn't actually used. Will close this thread now and crawl to my little cave of shame. lol
  • How to create splitted dialog window

    Cinema 4D SDK
    5
    1
    0 Votes
    5 Posts
    744 Views
    mikeudinM
    @m_adam said in How to create splitted dialog window: But in any case, here it's how it works. Thank you very much, Maxime! Great example!
  • 2 Votes
    2 Posts
    1k Views
    r_giganteR
    Hi Ashton, thanks for sharing your code. Best wishes for the incoming new year! Riccardo
  • Disabling a Protection Tag

    Cinema 4D SDK r21 python
    8
    0 Votes
    8 Posts
    2k Views
    ManuelM
    Hello, @blastframe said in Disabling a Protection Tag: tag[c4d.PROTECTION_P_X] = 0 you should use the right type, this is a Boolean. tag[c4d.PROTECTION_P_X] = False you can use those symbols to define the function : c4d.PROTECTION_NONE c4d.PROTECTION_LOCK c4d.PROTECTION_LIMIT tag[c4d.PROTECTION_P] = c4d.PROTECTION_NONE Last point, using SetParameter doesn't change the fact that you need to send a message to the tag. Cheers, Manuel
  • Layers with the same name?

    Cinema 4D SDK r20 python
    10
    0 Votes
    10 Posts
    1k Views
    M
    Since R21 sp1 issue regarding ByteSeq not being able to be printed in the Python Console is resolved. Cheers, Maxime.
  • 0 Votes
    7 Posts
    4k Views
    M
    The issue about PYTHONPATH is now resolved in R21 Sp2. Cheers, Maxime
  • Blend matrices

    Moved Cinema 4D SDK python
    6
    0 Votes
    6 Posts
    2k Views
    r_giganteR
    Thanks a lot Baca and I apologize for the hurried and shallow answer. Looking deeper in the argument the Computer Animation: Algorithms and Techniques reports: "While it should be obvious that interpolating the translation is straigthforward, it is not at all clear how to go about interpolating the rotations. In fact, it is the objective of this discussion to show that interpolation of orientations can be a problem. A property of 3x3 rotation matrix is that the rows and columns are orthonormal. Simple linear interporlation between the nine pairs of numbers that make up the two 3x3 rotation matrices to be interpolated will not produce intermediate 3x3 matrices that are orthonormal and are, therefore, not rigid body rotations. It should be easy to see that interpolating from a rotation of +90 deg about the y-axis to a rotation of -90 degrees about the y-axis results in an intermediate transformation that is nonsense. So direct interpolation of transformation matrices is not acceptable. There are alternatives representation that are more useful than transformation matrices in performing such interpolations: fixed angle, Euler angle, axis angle, quaternions." Considering your answer providing a reasonable solution using quaternions, I've played something similar using fixed angle def MatrixBlendFixedAngle(mxA, mxB, t): # get mxA scale AScale = mxA.GetScale() # get mxA offset AOff = mxA.off # remove from mxA the scale to retrieve rotation mxA.Scale(c4d.Vector(1/AScale.x, 1/AScale.y, 1/AScale.z) ) # retrieve the HPB representation of mxA AHPB = utils.MatrixToHPB(mxA) # get mxB scale BScale = mxB.GetScale() # get mxB offset BOff = mxB.off # remove from mxB the scale to retrieve rotation mxB.Scale(c4d.Vector(1/BScale.x, 1/BScale.y, 1/BScale.z) ) # retrieve the HPB representation of mxB BHPB = utils.MatrixToHPB(mxB) # execute the linear interpolations for offset, scale and HPB COff = (1 - t) * AOff + t * BOff CScale = (1 - t) * AScale + t * BScale CHPB = (1 - t) * AHPB + t * BHPB # calculate mxC from interpolated HPB mxC = utils.HPBToMatrix(CHPB) # add the interpolated scale mxC.Scale(CScale) # add the interpolated offset mxC.off = COff return mxC Finally with regard to your quaternion solution, for those who are interested in, a discussion on how to make use of quaternions is on GameDev. Cheers, R
  • Best way to get Enable status of an object?

    Cinema 4D SDK r20 python
    3
    1
    0 Votes
    3 Posts
    402 Views
    P
    Sorry I was not clear enough. Your answer (polygon object is "enabled" by definition) triggered me and now I understand. Thanks and my best wishes for a great 2020 for you, your family and your Maxon family. -Pim
  • c4dpy.exe and VS Code on Windows?

    Cinema 4D SDK python windows r21
    9
    1 Votes
    9 Posts
    3k Views
    M
    @rossc1 Thanks for the inputs, I will for sure add a note in the documentation regarding this issue. Just as a follow-up from the current status, it is confirmed and while there is a behavior change in our side due to the new licensing mechanism, the issue also comes from Visual Studio Code, reading directly raw string to detect a valid interpreter, and fail if something is not formated as it wants. However, we received the official confirmation from Visual Studio Code that they will not change their implementation, and not support custom interpreters. But we are still on it. Regarding your needs for an IDE, you can use Pycharm, the only pre-requires is to rename c4dpy to python, unfortunately, we can't officially recommend doing such things since newer OS (Catalina) prevent user changing content of an application package but @dskeith explained everything cleary in How to use c4dpy for Cinema4D R20 SP1. Cheers, Maxime.