Navigation

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

    • UNSOLVED Direction vector
      General Programming & Plugin Discussions • c++ general programming • • WickedP  

      3
      0
      Votes
      3
      Posts
      61
      Views

      Thanks Ricky, but I'm not sure if that's what I'm after. That looks like normal object rotation, but I'm trying to make a direction vector. The example given in a previous post did something like this: CreateRay(Ray* dst,Real x,Real y) { CameraMatrix = MyCam->GetMg(); Vector H = CameraMatrix.v1; Vector V = CameraMatrix.v2; Vector A = CameraMatrix.v3; Vector direction_vector = H + V + A; // how do I "add" 4.5° yaw to the direction_vector? // similarly for pitch dst->v = direction_vector; dst->p = CameraMatrix.off; } How do I "add" 4.5 degrees to the yaw with something like this (taking into account the camera's rotation as well)? I'd like to see the math so I can play around with that. If it's easier, think of it like this - I'm trying to create the standard camera ray without any lens effects (trying to keep it simple). How is the standard camera ray done? WP.
    • G

      UNSOLVED Trim a bitmap
      Cinema 4D Development • python general programming • • gsmetzer  

      5
      0
      Votes
      5
      Posts
      76
      Views

      G

      Thank you, @s_bach I have enough here to figure out what I need to do. Cheers!
    • G

      SOLVED OSC Plugin or simple Xpresso Script
      General Programming & Plugin Discussions • general programming • • geese780  

      4
      0
      Votes
      4
      Posts
      58
      Views

      G

      Hey Guys! Thank you very much for the insight! All of this makes sense, it helps me understand a little more about how the node part works! I really appreciate the time on this and thanks again for the help! I hope y'all are doing well! Cheers! MattG
    • D

      Mirror a matrix over a defined plane.
      General Programming & Plugin Discussions • python general programming brainstorming • • dany88  

      7
      0
      Votes
      7
      Posts
      76
      Views

      D

      @zipit Thank you. That'll help me.
    • G

      SOLVED ObjectData plugin not rendering to picture viewer
      Cinema 4D Development • python r20 general programming • • glasses  

      6
      0
      Votes
      6
      Posts
      64
      Views

      S

      Hello, as now said multiple times, GetActiveDocument() must not be used, but GetDocument()instead. What is the point of your In/Exclude list? Are these the objects you "rotate along the timeline"? This is typically not how a ObjectData object works; it generates objects based on its child objects or deforms objects in its hierarchy. It is not supposed to move arbitrary other objects. As mentioned above, a tag plugin may be the better solution. The "look_at_camera" example show such a plugin rotating its host object. best wishes, Sebastian
    • G

      Changing CUSTOMGUI_RANGE
      General Programming & Plugin Discussions • python c++ r19 general programming • • gsmetzer  

      5
      0
      Votes
      5
      Posts
      86
      Views

      Hi gsmetzer, with regard the use of the range slide in a resource file please have a look at <Cinema 4D folder>/resource/modules/olod.res: the LOD_BAR parameter is a range slider With regard to using the NodeData::GetDDescription() please check: py-dynamic_parameters_object_r18.pyp py-preference_r19.pyp py-spherify_modifier_r13.pyp Best, Riccardo
    • G

      UNSOLVED Delete marker with python
      Cinema 4D Development • python general programming • • gsmetzer  

      3
      0
      Votes
      3
      Posts
      55
      Views

      G

      Thank you @m_adam markers[0].Remove() worked in the Python Generator without crashing. I hope it isn't stupid to try this. I do plan on converting it to a plugin. Thanks, you can solve this question.
    • F

      SOLVED Python on Linux missing submodule?
      General Programming & Plugin Discussions • python r21 general programming • • fyeng  

      2
      0
      Votes
      2
      Posts
      34
      Views

      Hi fyeng, thanks for reaching out us. With regard to your question, I confirm that the workflow you're trying to achieve using the python executable found among the Linux CLR modules is not possible since only c4dpy, as you've already seen, has access to all the needed modules. Best, Riccardo
    • A

      SOLVED requirenments for building Cinema 4D extension
      General Programming & Plugin Discussions • general programming • • angel23  

      3
      0
      Votes
      3
      Posts
      61
      Views

      Hi angel23, thanks for reaching out us. With regard to your question the answer can be pretty wide depending on the depth you're aiming to tackle. Cinema 4D comes as @bentraje properly stated with C++ and Python APIs: whilst the first is bigger and more comprehensive the second is a specialized subset of the first and easier to approach. For the Cinema 4D API newcomers we recommend to stick to the Python API which gets rid of all the hurdles of the building process and to get proficient with it. Upon getting used to it and to the foundation Cinema 4D API concepts, moving to C++ won't be too complex. Best, Riccardo
    • A

      SOLVED version of python in Cinema 4D R21
      General Programming & Plugin Discussions • general programming • • angel23  

      3
      0
      Votes
      3
      Posts
      48
      Views

      A

      @m_adam thanks
    • I

      SOLVED Beginner:How to assign A-material to B-cube by python?
      Cinema 4D Development • python general programming • • ilad  

      3
      0
      Votes
      3
      Posts
      77
      Views

      I

      @r_gigante Thanks!Greate help for me! I got it!
    • I

      SOLVED Beginner:How to set A cube as the child of B cube by python?
      Cinema 4D Development • python general programming • • ilad  

      3
      0
      Votes
      3
      Posts
      52
      Views

      I

      @m_adam Thanks a lot, great help, I will try your way
    • I

      SOLVED Beginner:How to set axis to the bottom of a cube by python?
      Cinema 4D Development • python general programming • • ilad  

      6
      0
      Votes
      6
      Posts
      76
      Views

      M

      @ilad Well, it's not limited to non-animated objects. As @r_gigante posted, you're actually modifying the points and the matrix. Both operations can also be achieved manually. So, no difference if animated or not. The only thing you have to keep in mind when modifying animated objects is to make sure, all keys containing Matrix/PLA data have to be handled as well.
    • J

      SOLVED Brainstorm :To automatically create a data comparison animation by python
      General Programming & Plugin Discussions • python general programming brainstorming • • Joe132  

      3
      1
      Votes
      3
      Posts
      90
      Views

      J

      @m_adam Thank you very much ! it is certainly helpful !!
    • I

      SOLVED Beginner:How can i set a key-frame and value to a cube by python?
      Cinema 4D Development • python general programming • • ilad  

      5
      0
      Votes
      5
      Posts
      131
      Views

      M

      hello, thanks @tummosoft, it's nice to see it's helpful :D @ilad By the way instead of ID_BASEOBJECT_POSITION you could have use ID_BASEOBJECT_REL_POSITION. Both Ids are the same. If you want to know how to get those ids you can use the python console and drag and drop parameters, more information on this page In this case the DescID is composed of two DescLevel. The first define the Vector type, the second de Float type for X, Y and Z. (DescID can have less or more levels) To change the Size.Y of the cube, the descID will be : c4d.DescID(c4d.DescLevel(c4d.PRIM_CUBE_LEN, c4d.DTYPE_VECTOR, 0), c4d.DescLevel(c4d.VECTOR_Y, c4d.DTYPE_REAL, 0))) To change the scale of the object the descID will be : c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_REL_SCALE, c4d.DTYPE_VECTOR, 0), c4d.DescLevel(c4d.VECTOR_Y, c4d.DTYPE_REAL, 0))) Cheers Manuel
    • SOLVED Python module Inspect don't showing updated code
      General Programming & Plugin Discussions • python r20 general programming • • mikeudin  

      2
      0
      Votes
      2
      Posts
      125
      Views

      Hi @mikeudin, thanks for reaching out us. With regard to your request, although it's not expected it to work inside the Cinema 4D Script Manager you can get it properly working using the c4dpy executable (here's the 20.059 compatible version) as much as you do on the Python Shell or on SublimeText console as you can see from the log below. $ more test.py import inspect # Save this code as script py-file and start def main(): code = inspect.getsource(main_new) # place function code to str variable print code # print code text. Works on Python Shell, but not in C4D Scripts Manager def main_new(): # This is a comment # New comment string # Change this code, to check the console output pass if __name__ == '__main__': main() $ ./c4dpy.app/Contents/MacOS/c4dpy test.py def main_new(): # This is a comment # New comment string # Change this code, to check the console output pass $ Best, Riccardo
    • B

      SOLVED Use the Variable Name as an Argument
      General Programming & Plugin Discussions • python general programming • • bentraje  

      4
      0
      Votes
      4
      Posts
      184
      Views

      B

      @Cairyn and @m_magalhaes Thanks for the responses. The dictionary route seems like a good workaround. I think I'm going with it. Have a great day ahead!
    • R

      SOLVED Melting Edges
      General Programming & Plugin Discussions • python r20 r19 general programming • • rui_mac  

      3
      0
      Votes
      3
      Posts
      151
      Views

      R

      Thank you so much. I was thinging that I had to provide an edge index. Never thought that it would just require to select the points that define the edges. Great!!!
    • UNSOLVED Registering controller's events from within C4D
      General Programming & Plugin Discussions • c++ general programming • • intenditore  

      4
      0
      Votes
      4
      Posts
      220
      Views

      Sorry for late reply, there was an issue with my account. Many thanks for comprehensive answers. The topic looks kind of mind bending now, not much easier than after I realised Api doesn't really have what I expected to have for the task accomplishment Now I think the better way might be to simulate the mouse over the viewport, so it will be an independent app which will only need from the Cinema to know where the viewport is. That seems easier I hope. When my research or development will reach some success I will share what I learned here, maybe it will be handy for somebody else. Thanks once more!