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. SteveJLV
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 10
    • Best 3
    • Controversial 0
    • Groups 0

    SteveJLV

    @SteveJLV

    3
    Reputation
    72
    Profile views
    10
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    SteveJLV Unfollow Follow

    Best posts made by SteveJLV

    • Vector.__xor__(self, other) error in documentation

      f8e3cc6e-9c0d-4266-9d32-68447c0d8d88-image.png

      posted in Cinema 4D SDK python
      S
      SteveJLV
    • RE: How to keep the point coordinates of a polygonObject up to date in Python code

      I figured out how to do it.

      It's fairly simple. I just have to reassing the pointvalues after the Update

      so if I insert a new

      puntenLijst = op.GetAllPoints()
      testPnt = puntenLijst[0]
      

      the 'testPnt' has updated values.

      posted in General Talk
      S
      SteveJLV
    • Info GetUserDataContainer and RemoveUserData switched

      The samples under the GetUserDataContainer () and RemoveUserData seem to be other way around. Not a big deal but..

      5fc27bde-59e9-48a3-8637-f9dce6749955-image.png

      posted in Cinema 4D SDK sdk
      S
      SteveJLV

    Latest posts made by SteveJLV

    • Info GetUserDataContainer and RemoveUserData switched

      The samples under the GetUserDataContainer () and RemoveUserData seem to be other way around. Not a big deal but..

      5fc27bde-59e9-48a3-8637-f9dce6749955-image.png

      posted in Cinema 4D SDK sdk
      S
      SteveJLV
    • RE: How to use FILEOPEN_APPEND in the HyperFile Class ?

      I saved to a different directory and made shure that nothing was write protected, but still the "APPEND" mode throws an error.

      posted in Bugs
      S
      SteveJLV
    • RE: How to use FILEOPEN_APPEND in the HyperFile Class ?

      Apparantly the file gets saved as a read-only file.

      posted in Bugs
      S
      SteveJLV
    • How to use FILEOPEN_APPEND in the HyperFile Class ?

      if I replace the mode = c4d.FILEOPEN_WRITE with c4d.FILEOPEN_APPEND in the example as given in the SDK documentation I get a "cannot open file to write"- error.
      What am I doing wrong? It works fine with the "mode = c4d.FILEOPEN_WRITE "

      ca9e39d0-2c42-483c-97f3-41dd6413d92e-image.png

      and after running this I get:
      3c8cc966-d671-49a1-af6e-6e2f8c5d1dd0-image.png

      posted in Bugs
      S
      SteveJLV
    • Vector.__xor__(self, other) error in documentation

      f8e3cc6e-9c0d-4266-9d32-68447c0d8d88-image.png

      posted in Cinema 4D SDK python
      S
      SteveJLV
    • RE: How to get to the str-value in a UserData Integer Cycle

      @stevejlv I found a workaround: the value part in the value;string Cycle option list does not have to be 0,1,2 etc.
      So I can give them the exact value as the string part (as long as they are int) and get the value I want the old fashioned way: [c4d.ID_USERDATA,1]

      posted in Cinema 4D SDK
      S
      SteveJLV
    • RE: How to get to the str-value in a UserData Integer Cycle

      @s_bach Thanks for your reply, So I guess there is no 'easy' way to get the label value.
      I was working in a Python Generator's Object code and so filed my question under Python, my bad.
      I'll try to get it right with my next question. 😳
      and yes I meant this one:0_1552497629402_UserData.PNG

      posted in Cinema 4D SDK
      S
      SteveJLV
    • How to get to the str-value in a UserData Integer Cycle

      To get the USERDATA from op we simply use, for instance: op[c4d.ID_USERDATA,7]
      this will give us the value from the chosen option index (7) in my USERDATA
      Data Type : Integer, Interface : Cycle

      To get to the 'str' value which corresponds to this Option I constructed the following code:
      op.GetUserDataContainer()[8][c4d.DESC_NAME].GetContainer(c4d.DESC_CYCLE).GetString(op[c4d.ID_USERDATA,7])
      🤔
      it works but this seems to me like a little overkill (understatement)
      Is there a better/ correct way to get to the 'str'-value. Also I have to know the position in the GetUserDataContainer() (in my case [8]) to get to the value.

      posted in Cinema 4D SDK python
      S
      SteveJLV
    • RE: How to keep the point coordinates of a polygonObject up to date in Python code

      I figured out how to do it.

      It's fairly simple. I just have to reassing the pointvalues after the Update

      so if I insert a new

      puntenLijst = op.GetAllPoints()
      testPnt = puntenLijst[0]
      

      the 'testPnt' has updated values.

      posted in General Talk
      S
      SteveJLV
    • How to keep the point coordinates of a polygonObject up to date in Python code

      Hello, I try to manipulate a polygon point in Python with the SetPoint() command.
      So for instance I want to double the Values for X,Y en Z of point[0] = testPnt (for instance Vector(1,1,1))
      I use the values of the point to double them. (I used the '×' to indicate multiplication the '*' messes up the post)
      op.SetPoint(0,c4d.Vector(testPnt.x×2,testPnt.y×2,testPnt.z×2))
      If later somewhere else in my code I change these values again, say I triple them
      op.SetPoint(0,c4d.Vector(testPnt.x×3,testPnt.y×3,testPnt.z×3))
      and print the values I still get the unchanged values. i.e. Vector(1,1,1)
      I want to get (6,6,6) at the end.

      Here my testing code:

      def main():
          op = doc.GetActiveObject() #select a polygon object with Point[0] at (1,1,1) as example
          puntenLijst = op.GetAllPoints()
          testPnt = puntenLijst[0]
          print 'pnt0 at start: ' ,testPnt     # check the coordinates before manipulation 
          *#prints: pnt0 at start: Vector(1,1,1) ok*
          op.SetPoint(0,c4d.Vector(testPnt.x*2,testPnt.y*2,testPnt.z*2))
          print 'pnt0 after SetPoint:' ,testPnt
          *#prints: pnt0 after SetPoint: Vector(1,1,1) not ok, got to send Message(c4d.MSG_UPDATE)*
          op.Message (c4d.MSG_UPDATE)
          print 'pnt0 after MSG_UPDATE' ,testPnt
          *#prints: pnt0 after MSG_UPDATE: Vector(1,1,1) not ok, got to do the c4d.EventAdd()*
          c4d.EventAdd()
          print 'pnt0 after c4d.EventAdd():' ,testPnt
          *#prints: pnt0 after c4d.EventAdd(): Vector(1,1,1) not ok, got to do ??*
          op.SetPoint(0,c4d.Vector(testPnt.x*3,testPnt.y*3,testPnt.z*3))
          print testPnt
          # hoping for Vector(6,6,6) but nope got Vector(1,1,1)
      

      finaly in the Structure Manager after running this code the point has coordinates (3,3,3) and not (6,6,6) the last SetPoint used the startingpoint(1,1,1) and I want to continue with the changed values i.e. (2,2,2)

      posted in General Talk python
      S
      SteveJLV