HOW to export bezier curve to 3d software like cinema4d?

edited December 2013 in How To...

HOW to export bezier curve and points to 3d software like cinema4d?

Tagged:

Answers

  • Answer ✓

    By saving the points in the proper format, depending on what this software can import.

    Processing has a number of libraries for 3D export. See if one of them fits.

  • I got it to work now I saved position into a txt file and read the txt file using python script. Cinema4d project file below if anyone interested.

    https://dropbox.com/s/t63romtrre9byc4/pythonSplinne.rar

    bezier

  • Thanks for sharing this, I'm currently going through the same process and trying to learn how its done. Could I ask how you exported the positions out of processing into a txt files though?

  • edited January 2014

    Use PrintWriter: processing.org/reference/PrintWriter.html

    PrintWriter output = createWriter("output/fileName_"+(frameCount-1)+".txt");
          output.println(i + ", " + start.x + ", " + start.y + ", " + start.z
            + ", " + cp1.x + ", " + cp1.y + ", " + cp1.z
            + ", " + cp2.x + ", " + cp2.y + ", " + cp2.z
            + ", " + end.x + ", " + end.y + ", " + end.z
            );
        output.flush();
        output.close();
    

    There is also an example how to save data to txt file in Processing Example > Topics > File IO. Here is link to download Processing project file: https://dropbox.com/s/ppe8oz0d2nmccb1/Neuron3D_v10_export.rar In the project file, the code to export position of bezier vertex is on the line 133

  • Thanks a lot kn1c.

  • kn1c, I could help me with one more little thing if it's not to much? I have got a sequence of .txt files exporting out fine from processing with the right data. I'm struggling with how to read the sequence in c4d though. I have tried to strip the end of the string off and then add the keyframed 'offset' value to match the sequence files ( myfile_0.txt, myfile_1.txt etc) but dosnt seem to update the positions of the object in the scene.

    base, ext = os.path.splitext(csvfile) #strip .txt at the end of the string
        striped_num = ''.join([i for i in base if not i.isdigit()]) #strip the number at the end of the string
        csvfile = str(striped_num + str(offset) + ext) # add offset value to string to match sequence
    

    Have you had any luck with such a process?

  • Here is a simple sequence of 10 .txt files I am trying to work with at the moment for example. https://dropbox.com/sh/tt9v2d7e3ipjxbg/LYezjHC5Fx

  • edited January 2014

    I updated the code at line 11 to read a file accrding to current frame. open script > consle in c4d to see if it can't locate the file.

    your bill.txt has wrong format look at the attached file.

    https://dropbox.com/s/pchd3dp967v4a21/pypSp.rar

  • Thanks again kn1c, you've been a massive help for me in understand this process. Cheers.

Sign In or Register to comment.