Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Reading Object Pos&Angles from text file

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 133 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 14/11/2004 at 05:06, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   8.100 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;  C++  ;

      ---------
      I want to to use C4D R9 for a visualization. I have text file containing x,y,z position and x,y,z angles (attitude) of an object.

      How can I create an animation of an object by reading its position and attitude (angles) from an external file ?

      Each line in the file represent a new frame data (new position and new attitude) with the following entries;

      Format:

      FrameNo Xpos Ypos Zpos Xangle Yangle Zangle

      Data file Example :

      1   1.0 0.0 0.0    0.5 0.0 0.0
          2   1.1 0.2 0.0    1.0 0.0 0.0
          3   1.2 0.4 0.0    1.5 0.0 0.0
          4   1.3 0.6 0.0    2.0 0.0 0.0
      ...
      5000 -1.4 -12.0 340.0    45.0 125.4 -3.0

      Assume that we have a spacecraft object in C4D.
      What I want to do is for each frame read the the next line from the data file and move the spacecraft to Xpos, Ypos,Zpos and rotate it by Xangle, Yangle, Zangle. Repeat this process until no mode data line left in the data file ie. create 5000 frame movie.

      Can you suggest any method how to do this?

      Thanks

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 14/11/2004 at 09:14, xxxxxxxx wrote:

        You need to set up keyframes for the object's position and rotation for each 'frame' of data, setting the keyframe values from the file. In C++, there are several posts here that show how to do this, a couple of examples in the SDK code, and do not forget the SDK documentation. Check out Plugins/cinema4dsdk/source/MorphMixer.cpp.

        What you want to do is very similar to importing BVH data which is motion capture data at a regular time sample. Code to this effect would be easily converted to your purpose.

        For starters, select Show Topics "All", do a Search for "keyframe" using Search In "Message Body". This will give you plenty to get started.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post