• STEP/STP FILE IMPORT PYTHON DOCUMENTATION

    Cinema 4D SDK r20 python
    5
    0 Votes
    5 Posts
    4k Views
    T
    @mp5gosu @m_adam I'll test out these options and see how it works out. Thanks for the information guys, I appreciate it!
  • DeformCache Update

    Cinema 4D SDK r19 python
    3
    0 Votes
    3 Posts
    606 Views
    chuanzhenC
    @m_adam Thanks
  • TreeView: How to insert dragobject as new item

    Cinema 4D SDK r20 python
    2
    0 Votes
    2 Posts
    502 Views
    mikeudinM
    Solved. There is TREEVIEW_OUTSIDE_DROP option.
  • SpecialEventAdd and structures / containers

    Cinema 4D SDK r20 python
    2
    0 Votes
    2 Posts
    458 Views
    M
    Hi @pim, In Python, SpecialEventAdd can only pass integer value, so the sender part can store the data into the document BaseContainer send the SpecialEventAdd/ Process this event read back the data from the active document BaseContainer. You can find valuable information on this topic https://developers.maxon.net/forum/topic/8219/10712_pluginmessage-and-pycobject-solved/5. Cheers, Maxime.
  • Send message to tooldata

    Cinema 4D SDK r20 python
    4
    0 Votes
    4 Posts
    1k Views
    P
    @C4DS said in Send message to tooldata: PrepareData Your first answer works great! Thank you.
  • Drag&Drop in Editor window

    Cinema 4D SDK r20 python
    3
    0 Votes
    3 Posts
    576 Views
    P
    Yes - dragging session only occurs in a 2D space - I thought so. Thanks.
  • Transform mouse coordinates to c4d coordinates

    Cinema 4D SDK r20 python
    5
    0 Votes
    5 Posts
    1k Views
    P
    Thanks for the answer. I just started with a command plugin. New requirements emerged and yes, perhaps I now change over to a tool plugin.
  • Compute the Area of an Irregular Polygon?

    Moved General Talk r20 python
    6
    0 Votes
    6 Posts
    2k Views
    r_giganteR
    Hi Bentraje, thanks for following up and sorry for coming late here. I've checked your geometry and the issue is not with the algorithm, but in both cases with the geometries you're using to compute the area who don't shown vertexes being properly "ordered". The algorithm I've briefly presented requires the vertexes to be ordered as if you're visiting them by walking on the outer edge of your n-gon or polygon in CCW or CW. It is then mandatory to generate an ordered list of vertexes before passing the data to the function to get the correct result. [image: 1553532189426-62d2c929-154a-4c85-b558-af1536d3153d-image.png] In order to come out with such an ordered list I warmly recommend you to visit the following old-threads: Get all ngons PolygonObject.GetPolygonTranslationMap() Get outer edges of each Ngon Best, Riccardo
  • Getting a polygonal version of an animated mesh

    Moved Cinema 4D SDK
    3
    0 Votes
    3 Posts
    779 Views
    R
    Well, I do have a loop but I just pasted the code that would, hopefully, perform the calculation. And I did tried the GetDeformCache approach, but my mistake was, in fact the cloning of the object. Thank you so much for the code, Adam.
  • How to output BaseBitmap with ShaderData plugin

    Cinema 4D SDK python
    2
    0 Votes
    2 Posts
    612 Views
    r_giganteR
    Hi Merkvilson, thanks for reaching out us. If the final intent is to simply get BaseBitmapinformation to be returned by your shader, rather than sampling a Xbitmap shader I suggest instead to simply query the color information by using BaseBitmap::GetPixel and eventually apply color space transformation. def Output(self, sh, cd) : x = int(cd.p.x * self.bitmap.GetBw()) y = int(cd.p.y * self.bitmap.GetBh()) col = self.bitmap.GetPixel(x, y) return c4d.Vector(float(col[0]/256.0), float(col[1]/256.0), float(col[2]/256.0)) Best, Riccardo
  • 0 Votes
    4 Posts
    928 Views
    a_blockA
    Hi, I'm glad you found something working for you. I just want to mention, this way of using the deform cache directly will only work for very specific setups, for arbitrary object configurations you will most likely need to iterate through the cache. So, I think, it's worth to give those manuals another read. Also Maxime has posted some snippets in Getting a polygonal version of an animated mesh, which might be useful for you. Cheers, Andreas
  • GetActiveObjects(flags)

    Cinema 4D SDK python r20
    3
    0 Votes
    3 Posts
    618 Views
    P
    @s_bach Ok, Thanks.
  • GV Node AddPort fail

    Cinema 4D SDK python r19
    5
    1
    1 Votes
    5 Posts
    1k Views
    M
    This issue is now fixed in R21. Cheers, Maxime.
  • 0 Votes
    3 Posts
    724 Views
    B
    Hi Sebastian! Turns out my issues are two seperate, but equally self inflicted problems Inserting and activating works as expected, I am blocking the update with some custom UI stuff so I will have to find a solution for that. Calling EventAdd() in the closeEvent of the UI doesn't do anything. Is there another way to force Cinema to update everything? Killing the document not only doesn't update, but actually crashes Cinema, because I am trying to kill the document from within a callback that is reacting to MSG_DOCUMENTINFO_TYPE_LOAD. I am doing some more involved environment management and sometimes I have to close a document after loading. I have a workaround that will have to do for now. In the callback I change the document path to a string I can then look for in EVMSG_CHANGE. When I detect my string there, I can then kill the document. It's not very elegant and if anyone has a better solution I would be very happy, but otherwise consider this problem solved
  • How to check if a spline is a freehand spline?

    General Talk r19 python
    3
    0 Votes
    3 Posts
    904 Views
    S
    Hello, I just want to add that an example on how check a spline can be found in the BaseObject Manual. best wishes, Sebastian
  • Render from picture viewer programatically

    Cinema 4D SDK r20 python windows
    2
    0 Votes
    2 Posts
    608 Views
    r_giganteR
    Hi mafster, thanks for reaching out us. With regard to accessing images being available in the Picture Viewer, I'm sorry to confirm that there is no PictureViewer-related classes/functions exposed in the API. This is valid for both C++ and Python API. Best, Riccardo
  • 0 Votes
    4 Posts
    1k Views
    a_blockA
    Hi, good we got you going It is not wrong per se to use multiple plugin directories. Actually Cinema 4D R20 was specifically designed to have multiple ones. You just need to make sure not to have duplicate plugins in these directories. Cheers, Andreas
  • Cinema 4D Script: Web Search Selected Text

    General Talk
    4
    1
    2 Votes
    4 Posts
    1k Views
    mikeudinM
    @a_block said in Cinema 4D Script: Web Search Selected Text: I have added the "showcase" tag, so people are hopefully able to filter for your and other similar threads more easily. Great! Thank you!