• InExcludeData modifying in the ParalelFor?

    Cinema 4D SDK c++ s26 sdk
    7
    0 Votes
    7 Posts
    1k Views
    ferdinandF
    Hello @yaya And actually as I understand it is pretty logical. I have 2 InExData parameters in my plugin. So when I copying 3000 items into 2 InExData`s, plus adding 3000 objects into the scene, then the number of operations increases up to 9 000. It depends a bit on what you consider an 'operation' in this context, but I would say your calculation is at least misleading. Due to the copying nature of IncludeExcludeData::InsertObject, inserting objects is not a constant cost operation (other than your example implies). It scales linearly with the number of items already in the list (in practice probably even a little bit worse, because the copying itself calls a function which is non-constant). So, when you have a list with 5 items and add one, it is 5 + 1 = 6 - you must copy over the five old items and then add the new one - operations. And adding 5 items in total to an empty list would be 1 + 2 + 3 + 4 + 5 = 15 operations. The term operations is a bit fuzzy here, and there is a lot of room for interpretation, but what I want to make clear is that adding an item to an InExcludeData is not a constant operation. So, adding 3000 items to an InExcludeData does not result in 9000 operations, but 4498500. From this also follows, that it is computationally advantageous to store items in a larger number of lists, e.g., adding to two InExcludeData 1500 items each, costs 1124250 operations per batch, i.e., 'only' 2248500 operations for all 3000 items. Splitting up the data is IMHO your best route of optimization. InExcludeData is also simply not intended for such a large number of objects being stored in them. And as stressed before: I would really test first if InExcludeData is indeed the culprit. ::InsertObject has been designed in a way which does not mesh that well with what you want to do. But I do not really see it eating up 10 seconds, even for 3000 objects. I personally would expect the other calls in your loop to take up more time. But that is very hard to guesstimate from afar, and I might be wrong. Cheers, Ferdinand
  • 0 Votes
    5 Posts
    721 Views
    DunhouD
    @m_magalhaes Thanks for that explain.
  • 0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hello @jack0319, Yes, this is a bug. I had to do some digging first (debug against c4d) to find out what is going wrong here. It seems like this is a bug in the scroll group gadget. I was unable to pinpoint what is going exactly wrong, but when a new document is created, the scroll group position is set again, because Cinema 4D is reinitializing its layout. You currently cannot do anything about this. I have filed a bug report on our bug tracker and will update this thread when the bug has been fixed. We cannot make any guarantees regarding an ETA and considering that this is a negligible impact bug, it could take multiple revisions until the bug is fixed. Cheers, Ferdinand
  • Node port Vector2 value is not recognized by Python

    Cinema 4D SDK
    3
    0 Votes
    3 Posts
    512 Views
    C
    Thank you for the answer Manuel
  • 0 Votes
    7 Posts
    831 Views
    DunhouD
    @m_magalhaes Hey, It's hard to change python to c++ to me now, I type the code in vs2019, and It is a lot of bugs like :: after has a class namelike this or something like this. I also check Logerr topic form kbar, And all of it is bit hard to me to approach it, I guess since I can log some text to ohers Logger like Rendererwith maxon.Loggers , It probly can work for me -- Maybe the most dowside is I can not custom the logger name . As bad obsessional it is a little anosing. Will python can do this or a Logger example for cpp githubin the furture if give a code out of box is not the purpose of the blog? Sorry to that , I tried since a read this post and I realized I cann't make C++ works for me as soon.
  • 0 Votes
    14 Posts
    1k Views
    DunhouD
    @ferdinand Thaks for all of that explains . With your detailed and friendly explains , A new habbitor like me can code within Cinema 4D as well . Thanks for that !
  • 0 Votes
    4 Posts
    839 Views
    ferdinandF
    Hello @kng_ito, I agree that it is odd, or as you nicely put it, unkind. The problem is also that the meaning of segments in the context of a SplineObject (the data count of the Tsegment tag) and a LineObject (the data count of its Tline tag) is being mixed up. B(Cache).GetSegmentCount() = 2 <- A LineObject instance. B(Cache).GetTags() = [ <c4d.VariableTag object called with ID 5712 ... <- The Tline tag. <c4d.VariableTag object called with ID 5680 ... <c4d.SegmentTag object called with ID 5672 ... <- The Tsegment tag for the host. <c4d.PointTag object called with ID 5600 ... ] The problem of this design is that LineObject.GetSegmentCount returns the segment count in the sense of its host object, the SplineObject, as the number of disjunct curve sections in the spline (segment tag). The segments in the sense of a LineObject, the number of line segments the hosting spline object has been quantized into in the LineObject (line tag), is only indirectly accessible over getting the Tline tag of that object. Which in turn might confuse users why they cannot get a specific segment as you wanted to. But this design was apparently intentional and aims at minimizing the number of tags in the traverseable scene-graph (things inside caches are out of sight so to speak and not a problem). It is therefore unlikely that we will change this. The best I can do for now, is adding a note to LineObject.GetSegmentCount and SplineObject.GetSegmentCount which hints at the problem. Cheers, Ferdinand
  • How to get Viewport pixel color

    Cinema 4D SDK s26 python
    4
    1
    0 Votes
    4 Posts
    454 Views
    chuanzhenC
    @ferdinand Hi,i use RenderDocument in python,although it is a little slow and needs to wait for a second, it works successfully. Thanks for your help,gif show it works: [image: 1660008431592-ssss.gif]
  • Filename Gui how get empty folder path

    Cinema 4D SDK python s26
    3
    1
    0 Votes
    3 Posts
    398 Views
    chuanzhenC
    @ferdinand Thanks. I create Filename Gui in CreateLayout it work,this is code: bc = c4d.BaseContainer() bc.SetBool(c4d.FILENAME_DIRECTORY,True) self.AddCustomGui(1012, c4d.CUSTOMGUI_FILENAME,"",c4d.BFH_SCALEFIT, 50, 20, bc)
  • 0 Votes
    10 Posts
    2k Views
    DunhouD
    @ferdinand It seems more complicate and detailed doc in C++ document than python. I will be helpful to move on. Thanks to that
  • How to detect a new light and pram change?

    Cinema 4D SDK s26 sdk python windows
    6
    0 Votes
    6 Posts
    2k Views
    DunhouD
    @bentraje Thanks a lot ! I always want to spend some thing to do this , but unfortunately I am struggling to work with rendering . If I have some time hopes I can change this a bit more
  • Set IRR settings

    General Talk
    3
    0 Votes
    3 Posts
    869 Views
    I
    Works like a charm, thank you!
  • 0 Votes
    15 Posts
    3k Views
    M
    Hi with the Release 2023.1 the bug with maxon.AssetInterface.GetAssetUrl have been resolved. Cheers, Maxime.
  • Get the preview images from c4d files

    Cinema 4D SDK c++ s26
    5
    0 Votes
    5 Posts
    1k Views
    H
    thanks that works.
  • How to Set Node Spcace use python?

    Cinema 4D SDK
    5
    0 Votes
    5 Posts
    886 Views
    M
    Just a note as mentioned in the documentation BeginTransaction must always be used with the "with" statement, otherwise it could cause Cinema 4D to freeze. Cheers, Maxime.
  • Export multiple GLB files via script

    Cinema 4D SDK
    2
    0 Votes
    2 Posts
    458 Views
    ManuelM
    Hi, We have an example on github to export to obj and how to define the parameters, you can find it here You need to retrieve the plugins with its plugin ID GLTFEXPORTER_PLUGIN_ID 1041129 There is no symbol attached for it. Then, you must send the message MSG_RETRIEVEPRIVATEDATA to define the option you want. For each parameter you will find its ID in the following file : \resource\modules\gltf\description\fgltfexporter.res You will find that the parameter you want to change is c4d.GLTFEXPORTER_FILEFORMAT and it should be set to c4d.GLTFEXPORTER_FILEFORMAT_GLB So just like in this line, you will write objExport[c4d.GLTFEXPORTER_FILEFORMAT] = c4d.GLTFEXPORTER_FILEFORMAT_GLB You should be able to clean the code from the obj example and adapt it to your needs. That will help for your thousands of exports. Cheers, Manuel
  • Python - Gradient userdata - Set colour and alpha

    Moved Bugs python s26
    2
    1
    0 Votes
    2 Posts
    754 Views
    ferdinandF
    Hello @pixelsinprogress, Thank you for reaching out to us. I must unfortunately tell you that it currently is technically not possible to set the alpha values of a c4d.Gradient instance in Python. In C++ this works because there Gradient::GetAlphaGradient returns a pointer to the underlying alpha gradient. The Python layer unfortunately makes a copy of that layer, severing the connection between the alpha gradient and its associated color gradient (which is also why the Python docs warn about that). I also tried some other venues of poking around in the alpha data by using C4DAtom.SetParameter, but these unfortunately also do not work in Python. I have created a ticket for this to be fixed at some point, as I would agree this is something the Python layer should be able to handle. But this is not a bug, as this was done somewhat intentionally. So, it might take a long time before we (most likely @m_adam) will find the time to do it. Cheers, Ferdinand
  • Add Field to Effector

    Cinema 4D SDK s26 python
    4
    0 Votes
    4 Posts
    834 Views
    M
    Hello @InterfaceGuy, without further questions or postings, we will consider this topic as solved by Wednesday 31/05/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • Can a Render Token contain Special Characters?

    Cinema 4D SDK
    7
    0 Votes
    7 Posts
    871 Views
    DunhouD
    @ferdinand A little update for this topic , my final solution for this problem is reg some tokens , and reg a plugin to analysis the project name and set token string depend on project name structure . like a project name has a version sign like _v , than the output path set a $v for render . All the tokens can set by the analysis plugin . It is a bit stupid way but work well for a quickly set render path just one click. Cheers
  • SDK docs do not reflect changes to dialog borders in S26

    Moved Bugs python s26
    2
    0 Votes
    2 Posts
    822 Views
    ferdinandF
    Hello @a_block, Thank you for reaching out to us and pointing out these flaws. We are aware of these changes but since it was for quite some time unclear if these changes were intentional or not, we postponed documenting them. The changes to the look and functionalities of GeDialog borders will be included in an upcoming documentation. But since these changes effectively demand symbols or even function arguments to be deprecated, this would be more a developer's task than a documentation task. I can of course put a note into the documentation, but this would only be a band aid. I will try to find a clean solution by poking the relevant devs. Cheers, Ferdinand