• Simple way to save images?

    r21 python
    5
    0 Votes
    5 Posts
    600 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?

    r21 python
    3
    0 Votes
    3 Posts
    356 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!
  • GUI Layout Issues

    python sdk
    4
    2
    0 Votes
    4 Posts
    639 Views
    ?
    @m_adam You are a legend! I've learned a lot about UI in Cinema 4D from this post, thank you very much.
  • Prorender style viewport rendering

    2
    0 Votes
    2 Posts
    483 Views
    r_giganteR
    Hi eldiren, thanks for reaching out us. With regard to your request, please consider that ProRender has been integrated by using a non-public API which among the different features also gives permits to integrate the renderer buffer with the viewport. At the moment aside from the documentation about VideoPostData for non-interactive or semi-interactive rendering purposes and the approach seldom used of representing in a GeUserArea or via the SceneHook::Draw function the results of a renderer buffer, there are not yet examples showing how to integrate external renderers in Cinema 4D. Best, R
  • Insert object in Treeview

    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)
  • Access the Object List Xpresso Node for Python Iteration

    python r21
    10
    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!
  • String compare

    7
    0 Votes
    7 Posts
    898 Views
    C4DSC
    @m_magalhaes Thanks for bringing this up, as it seems I had overlooked it on multiple occasions. Which also points me to the fact that the R19 SDK did have a String::operator == () Also overlooked that all those years. I need better glasses.
  • Bend Deformer Using C++

    c++ r19 sdk
    18
    2
    0 Votes
    18 Posts
    3k Views
    M
    Yes because I've done it
  • Execution Delay When Reading Data from JSON file

    r21 python
    6
    0 Votes
    6 Posts
    865 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.
  • Building Cinema 4D SDK on Windows

    r21 c++ sdk windows
    3
    0 Votes
    3 Posts
    619 Views
    W
    Thank you @m_magalhaes! I needed to open the plugins.sln solution instead of the project file. I feel like I've learned something, but I'm not sure what
  • R21 BaseDraw::DrawPointArray draws squares versus circles in R20

    c++ r20 r21
    4
    1
    0 Votes
    4 Posts
    553 Views
    ManuelM
    Hello Sorry for the delay, Christmas time didn't helped. I've opened a bug entry for that issue. I'll be back when i'll have more information. I've added the "Bug report" tag to this thread Cheers, Manuel
  • Always use unique Module ID

    Locked
    1
    1 Votes
    1 Posts
    1k Views
    No one has replied
  • Adding points to a spline

    python
    3
    0 Votes
    3 Posts
    813 Views
    ManuelM
    hello, without information from your part, i'll consider this thread as solved and change its states Cheers, Manuel
  • Disabling a Protection Tag

    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
  • Detect Keyboard in a Shader Dialog.

    3
    0 Votes
    3 Posts
    577 Views
    RenatoTR
    Hi Riccardo, many thanks for the infos Cheers Renato
  • 0 Votes
    2 Posts
    492 Views
    r_giganteR
    Hi Jenandesign, thanks for reaching us. With regard to your request, the reason of the change is due to the new Python console brought out since R20 where by dragging a parameter from the UI in the console provides the user with the complete "route" to propelry evaluate the parameter. This is by design and won't be reverted back in future releases. Best, Riccardo
  • Blend matrices

    Moved python
    6
    0 Votes
    6 Posts
    1k 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?

    r20 python
    3
    1
    0 Votes
    3 Posts
    396 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
  • Take Viewport Screenshot

    r21 python
    6
    0 Votes
    6 Posts
    2k Views
    B
    Thank you all for the response. Appreciate a lot. Specially for the sample code provided by @m_magalhaes as this is my code relating to rendering.
  • Viewport render and camera FOV

    c++ r21
    6
    0 Votes
    6 Posts
    1k Views
    ManuelM
    Hello, That's a more wide discussion about how to code. We can say that as long as it compile and your plugin is working, your code is fine. Cinema 4D is provided for both Windows and OSX, so differences can be introduces. Using our datatype guaranty (unless a bug) that your code will work the same on both OS. (of course there's always exception, don't jump on them ) Same goes for external librairies. Another example is our thread/job system, some external librairies can interfere with cinema4D in a badly way. Cheers, Manuel