Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. SweepingMotion
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 16
    • Best 2
    • Controversial 0
    • Groups 0

    SweepingMotion

    @SweepingMotion

    2
    Reputation
    6
    Profile views
    16
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    SweepingMotion Unfollow Follow

    Best posts made by SweepingMotion

    • RE: Can I make a hierarchy of nulls inside a Python Generator behave like on in OM?

      @i_mazlov sorry I thought I deleted this post as I solved the issue.

      Anyway to anyone who stumbles upon this question here's how I solved it:

      for i,pt in enumerate(points_list[::-1]):
      
          off = c4d.Vector(distance * i,0,0 )
          mg = pt.GetMg()
          mg.off = off
          print(rotation.x)
          rm = c4d.utils.HPBToMatrix(rotation)
          pt.SetMg(mg * rm)
      

      So basically if the objects are inserted in the hierarchy and you start from the last one with the transformations this will work just like in the OM.

      posted in Cinema 4D SDK
      S
      SweepingMotion
    • RE: Changing axis rotation position

      @ferdinand I've played with your idea for a bit and then realized, that the point where the adj meets the ground is wrong, as it should be the point where a circle or f = opp with center in O meets the ground. Eventually I decided to just hack it a bit and change the position of the rotating object and the object inside to counter that move. Here's the result:

      posted in General Talk
      S
      SweepingMotion

    Latest posts made by SweepingMotion

    • RE: Changing axis rotation position

      @ferdinand I've played with your idea for a bit and then realized, that the point where the adj meets the ground is wrong, as it should be the point where a circle or f = opp with center in O meets the ground. Eventually I decided to just hack it a bit and change the position of the rotating object and the object inside to counter that move. Here's the result:

      posted in General Talk
      S
      SweepingMotion
    • RE: Changing axis rotation position

      Thank you

      posted in General Talk
      S
      SweepingMotion
    • RE: Changing axis rotation position

      @mogh @ferdinand
      I'm building a python tag to handle these cards:
      cards_script_v01.mp4
      Works quite well when cards are flat. But I'd like to add some thickness. At the moment when crossing the vertical I move the top object to where the pivot should be and move the inside object in the opposite direction:
      cards_script_v01-thickness.mp4
      I was wondering though if there might be a better way of doing it.
      The image in my original post was showing the situation - rotation around the central point at the base vs rotation around the corner of the base. Sorry if I didn't make myself clear.

      @ferdinand How would I construct this vector in c4d in python?

      posted in General Talk
      S
      SweepingMotion
    • Changing axis rotation position

      What I'm trying to do is a python tag that wobbles a cube inside a null - so in fact wobbles the null itself. vector-01.png
      The rotation axis is centered on the cube's base. When it's at 0 degrees that's its axis rotation. However when it's below, the axis moves to one corner, and then the opposite happens for positive rotation.

      I would like to know how I can find out and offset that would allow me to rotate the black cube around the base center and then move it to the position it would have if it rotated around the corner. So basically the V vector on the drawing.

      Unless there's a better way of changing the pivot point.

      posted in General Talk python 2024
      S
      SweepingMotion
    • RE: Python field error

      @m_adam said in Python field error:

      A fix is coming in one of the next version of Cinema 4D, so that OutputBlockSize == InputBlockSize and therefor you will not need to add this "useless" values at the end to fullfill the outValues.

      That's great news. I'll hold off till then.

      posted in Cinema 4D SDK
      S
      SweepingMotion
    • RE: Need help with python field - infection

      Thank you @ferdinand that is fantastic help.

      I think I'm going to put it on ice till I learn how to do a c++ field. What you made it almost exactly what I want BUT, I don't want to set the growth seeds - places where the growth starts, but rather add them dynamically. Think a balloon that touches a needle and it starts tearing from there, because that's exactly what I want to do.

      posted in Cinema 4D SDK
      S
      SweepingMotion
    • RE: Need help with python field - infection

      Thanks. I'm writing a python field.
      What I want to do is have vertex map grow from certain points, but dynamically so I don't have to use freeze which from what I gather you can only set once.
      I played with the python field and it indeed goes over the points in chunks of 400. This is where the block came from. It's called that in the input field manual in the SDK.
      I'll see if the neighbour function works.

      posted in Cinema 4D SDK
      S
      SweepingMotion
    • RE: Python field error

      Yep that seems to do it.

      posted in Cinema 4D SDK
      S
      SweepingMotion
    • Need help with python field - infection

      Hi I'm writing a field effector that will work like infection in xparticles and need some pointers.
      The logic is:

      1. Weights are added based on objects from an object list influencing a vertex unless the vertex is on an INFECTED or DEAD list
      2. If a vertex has weight of over 0 it's added to the INFECTED list.
      3. All vertices from the INFECTED list have their weights increased every frame.
      4. If a vertex weight exceeds some threshold it's added to the DEAD list - it cannot be influenced by the field anymore.
      5. Every infected vertex has a chance of infecting neighbouring vertices within a radius (unless they are already on the INFECTED or DEAD list)

      My questions are:

      1. The most important one: does a way of doing it already exist. What I want to do is have balloons simulation that dynamically pop when encountering and object from a list.
      2. I understand that vertices are given in blocks. How would I efficiently iterate over all of them - is there an option to thread/multiprocess them? Does anyone know of any example code I can follow and learn?
      3. How do I get neighbours of a vertex when it's neighbours might be in a different block?
      posted in Cinema 4D SDK python 2024
      S
      SweepingMotion
    • RE: Python field error

      Here's what's happening.
      I think I understand now - the input data is given in blocks of 400 points. And I need to traverse those blocks to get all the points.

      posted in Cinema 4D SDK
      S
      SweepingMotion