Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. Tags
    3. general programming
    Log in to post

    • UNSOLVED A GetClone problem about takes
      General Programming & Plugin Discussions • python general programming • • delizade  

      4
      0
      Votes
      4
      Posts
      61
      Views

      Hi @delizade, thank you for reaching out to us. There are two problems with your code: You are using C4DAtom.GetClone() and GeListNode.InsertUnder() to add and clone a take. You should instead use TakeData.AddTake() which also provides a cloneFrom argument (Link for AddTake). You are cloning and inserting the main take, which leads in Python to hiccups. Because even when you do it correctly, like discussed in this thread via AddTake, it will insert a second "main take" into a document. I.e., one which has no "inherit from parent" and "default cemara/rendersettings" icons. According to one our devs, No. 2 seems to be a Python bug and not a limitation, we will investigate that. For now you would have to clone the two child takes under the main take manually in Python (and add a parent take beforehand if you want this structure). Because otherwise you will end up with two "root/main" takes in your document, confusing Cinema 4D ;) Cheers, Ferdinand
    • SOLVED Get viewport image of inactive document.
      General Programming & Plugin Discussions • c++ general programming • • Danchyg1337  

      7
      0
      Votes
      7
      Posts
      61
      Views

      @m_adam Thanks for your help. That made things clear.
    • SOLVED Using GetViewportImage()
      General Programming & Plugin Discussions • c++ documentation general programming • • Danchyg1337  

      3
      0
      Votes
      3
      Posts
      32
      Views

      @m_magalhaes Thanks a lot! That makes things clear.
    • E

      SOLVED BaseLink crash and tracking PolygonObjects/InstanceObjects in cache
      Cinema 4D Development • c++ bug report general programming brainstorming • • ECHekman  

      3
      0
      Votes
      3
      Posts
      49
      Views

      Hi, without further feedback, we will consider this thread as solved by Monday and flag it accordingly. Cheers, Ferdinand
    • SOLVED Accessing object container in C++.
      General Programming & Plugin Discussions • c++ r21 general programming • • Danchyg1337  

      4
      0
      Votes
      4
      Posts
      51
      Views

      M

      Hi internally as stated in the documentation of GeListNode._setitem__ and GeListNode._getitem__ it's just a wrapper arround respectively C4DAtom.SetParameter and C4DAtom.GetParameter. Then Set/GetParameter will call the respective NodeData.G/SetDParameter of the GeListNode implementation. This method lets you define how the parameter access is done (aka retrieving the data from a local member variable or reading the base container made by the description). So if we go back to the s/getitem, internally in python it builds automatically a DescId based on the data provided doing a stupid If pyData.Class == PyBool: DescId(pyData, DTYPE_BOOL, 0) so you can easily reproduce this part too. But I don't think in C++ you can't support multiple arguments in the bracket operator see C++ [] array operator with multiple arguments?, so you could somehow hack around with the usual () operator, but our classic API doesn't really provide a mean of inspection so you will need to either do a lot of overrides or have unsafe void pointer arguments while PythonObject always has a type attached to them so you can at any time accept a PyObject* and retrieve is real DataType, and this is exactly what is possible to do with the MAXON API where you register datatype as MAXON_DATATYPE then they all can be retrieved in the form of a maxon::Data but you still have access to its maxon::Id and you can know the datatype ID and doing a safe casting. Hope this answers your questions. Cheers, Maxime.
    • SOLVED Moving a Point Along an Arc by Distance from another Point
      General Programming & Plugin Discussions • python general programming • • blastframe  

      7
      0
      Votes
      7
      Posts
      72
      Views

      @zipit My sincerest gratitude for your help. Not only did you get my project unblocked, but you answered my follow-up questions. I have learned a lot from you. Thank you!
    • SOLVED How to fillet a ObjectData edge in Python?
      General Programming & Plugin Discussions • python general programming • • blastframe  

      9
      0
      Votes
      9
      Posts
      133
      Views

      @zipit Absolutely incredible work! So elegant! Thank you very much @m_adam Thank you for the reply and confirmation!
    • SOLVED Maximize/Resize "Add Motion Clip" Window
      General Programming & Plugin Discussions • python general programming general notes • • Leo_Saramago  

      3
      0
      Votes
      3
      Posts
      31
      Views

      @zipit Thanks!
    • J

      SOLVED GLB extract textures
      General Programming & Plugin Discussions • python general programming • • JohnSmith  

      7
      0
      Votes
      7
      Posts
      299
      Views

      J

      @Macsmiller I apologize for the late reply. Here is the plugin. glTF Importer plugin I managed to finish it and integrate it into Cinema 4D. You can follow the updates here: glTF Importer topic Maybe I am asking a question in the wrong topic - where can I find some sample code that can be used to create various import settings and write them to default presets.lib4d?
    • SOLVED XPresso: enable/disable user data
      Cinema 4D Development • general programming • • Passion3D  

      5
      0
      Votes
      5
      Posts
      51
      Views

      Work fine :) Thanks a lot Manuel
    • C

      SOLVED Best way to fill a maxon::BaseArray
      General Programming & Plugin Discussions • c++ general programming brainstorming • • C4DS  

      6
      0
      Votes
      6
      Posts
      131
      Views

      Unfortunately, differently from std lib where it's possible to define and init a vector pretty easily using one-line statement( std::vector<int> a (10, 100);) this looks like being not currently possible with maxon::BaseArray() and you need to make it the usual way. Best, R
    • C

      Cross platform screencapture code
      General Programming & Plugin Discussions • r20 c++ r21 r19 general programming • • C4DS  

      5
      0
      Votes
      5
      Posts
      81
      Views

      M

      Hi @C4DS, just to confirm that there is nothing built-in Cinema 4D. For python most of the library in the end only reroutes through OS call and does have a system dependant call, so you will probably end with something like that also in C++. Cheers, Maxime.
    • T

      SOLVED Python script for Rectangle Selection with options
      General Programming & Plugin Discussions • python r21 general programming • • Tennet  

      4
      0
      Votes
      4
      Posts
      83
      Views

      T

      Hi Manuel and @rb_rodrigo, Many thanks for the tips about the Python console and help with the code. I'm a beginner (not even that!) in scripting, so much appreciated. It works as expected now! Cheers, Frederik
    • SOLVED escape unicode characters in filepath
      General Programming & Plugin Discussions • python general programming brainstorming • • lasselauch  

      7
      0
      Votes
      7
      Posts
      128
      Views

      M

      Hi, @lasselauch as a rule of thumb with Python2.7 always store data as a Unicode string. Control your IO which means, for each, Input make sure you know the encoding in all cases by always calling .decode('utf-8') so you are sure to store a Unicode value and get an error if something went wrong at a loading time. Then output the content according to your need some need ASCII, some can work with unicode, but do the conversion on the fly, don't touch you stored Unicode data. For the francophone people, there is this fabulous article about unicode Encoding in Python for English I guess the best I found on this topic is A Guide to Unicode, UTF-8, and Strings in Python. Cheers, Maxime.
    • SOLVED Render to Picture Viewer with fields problem.
      Cinema 4D Development • r20 c++ general programming • • Danchyg1337  

      7
      0
      Votes
      7
      Posts
      81
      Views

      @m_adam Thank you for reply. I would probably send my code to your email to try to figure it out better. What i see so far is that in renderer, fields returns 0 for each point they sample. I have a function which samples fields and accepting a result to each vertex. For example imagine extrude with fields. In viewport i see extruded points, but in renderer everything is flat, like there is no field or it is so far to make any extrusion and returns 0. for each point. Second is more likely due to my tests.
    • SOLVED "History" xpresso node python analogue?
      Cinema 4D Development • python general programming • • intenditore  

      12
      0
      Votes
      12
      Posts
      88
      Views

      M

      hi, can we considered this thread as solved ? (at least we answered your question) Without further feedback i'll set it to solved tomorrow. Cheers, Manuel
    • SOLVED Modeling Kernel Error : Invalid Object
      General Programming & Plugin Discussions • r20 c++ general programming • • Danchyg1337  

      2
      0
      Votes
      2
      Posts
      43
      Views

      M

      Hello and welcome to the forum, For your next threads, please help us keeping things organised and clean. I know it's not your priority but it really simplify our work here. Q&A New Functionality. How to Post Questions especially the tagging part. I've added marked this thread as a question so when you considered it as solved, please change the state :) In your code you Resize the object after initialized for the modeling command. That's why. but probably a simpler way to achieve what you want is to access the polygon's data. The PolygonObject is inherit from PointObject where you can retrieve the pointer of the points' vectors with GetPointW sometthing like so will work Vector* padr{ pol->GetPointW() }; if (padr == nullptr) return maxon::NullptrError(MAXON_SOURCE_LOCATION); padr[3] = Vector(-2, 0, 0); You can have a look at our "roundtube" example in the sdk.zip file that ship with every Cinema 4D version. This example will show you how to create a primitive from scratch. Cheers, Manuel.
    • P

      SOLVED def Message - What Message is triggered when an Object is created or moved in the hierarchy.
      Cinema 4D Development • python general programming • • Pryme8  

      5
      0
      Votes
      5
      Posts
      117
      Views

      P

      Thank you so much! This helps me a lot with the understanding of what was going on. I am digging back into my work on this today and will follow up with your advice.