Backplates & HDRI
Backplates & HDRI

graphos

Regular Member
  • Content count

    69
  • Joined

  • Last visited

Community Reputation

23 Excellent

About graphos

  • Birthday 02/19/1995

Contact Methods

  • Website URL
    http://graphos.xyz

Profile Information

  • First Name
    Adam
  • Last Name
    Maxime
  • C4D Ver
    R18 Demo
  • Location
    France

Recent Profile Visitors

598 profile views
  1. I just wanted to add for people who keep saying new core doesn't coming, if you lok at the current sdk you will see a lot of function accept a thread as argument for being executed into another thread. Even if multi threaded doesn't mean multi processor, it's show us, MAXON try to parallelize their core, and it's a huge step for making it working into multiple processor ;)
  2. Basicly row["R.H"] get the content of the row R.H. According to your last information Ithinked the data into it was for exemple 90° and not 90. So Since we need number and I guess you understand ° is not a muber so I remove it. For removing it I simply do the content of row["R.H][:-1:] where [:-1] remove the last character. And then I convert everything to flaot, like that we are sure we get number. So basicly just change the line by r_h = float(row["R.H"]) and it should work
  3. If it just for file reading I really discourage you to use it. For make it to work you have to download it and put it into the user folder. (C:\Users\XXX\AppData\Roaming\MAXON\CINEMA 4D RXXX\library\python\packages\win64) but for make it work you also have to install all the dependancy (numpy and maybe some other...) Wich again it's pretty boring cause you have to compile numpy for your version. You can find some numpy version compiled by Nicklas but there a a bit outdated (not too much just 2/3 releae ahead of the current version of numpy) http://www.plugincafe.com/forum/forum_posts.asp?TID=13558 So it's a lot of work. And if you have to share your script thoses people will must need thoses files too. So it it's another "problem" of how to send this. So if it's just for reading file again do it directly with python struct it will be more easy for you if you are not confortable with module and other things ;)
  4. Take a look here Just and so for abc it give us: import c4d import os def get_current_frame(): frame = int(doc.GetTime().GetFrame(doc.GetFps())) return str(frame).zfill(4) def save_obj(): save_path = "C:\\Users\graphos\\Desktop\\Nouveau dossier" path = str(os.path.join(save_path, "{}.abc".format(get_current_frame()))) c4d.documents.SaveDocument(doc, path,c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, 1028082) def main(): total_frame = 100 for i in xrange(total_frame): save_obj() c4d.CallCommand(12414) # Go to Next Frame c4d.EventAdd() if __name__=='__main__': main()
  5. #CSV Importer exemple by graphos #12/07/2017 import c4d import csv def add_mesh(num, name, r_h, p_x, p_y, outer_radius): #Create obj in memory disc_obj = c4d.BaseObject(c4d.Odisc) poly_obj = c4d.BaseObject(5174) #Set obj names disc_obj.SetName("{}-Alpha {}".format(str(num).zfill(2), name)) poly_obj.SetName("{}-{}".format(str(num).zfill(2), name)) #Set disc_parameter disc_obj[c4d.PRIM_DISC_ORAD] = outer_radius disc_obj[c4d.ID_BASEOBJECT_REL_ROTATION,c4d.VECTOR_X] = r_h disc_obj[c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_X] = p_x disc_obj[c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_Y] = p_y #remove visiblity for poly_obj and set with/height poly_obj[c4d.ID_BASEOBJECT_VISIBILITY_RENDER] = 1 poly_obj[c4d.PRIM_POLY_WIDTH] = 0.1 poly_obj[c4d.PRIM_POLY_HEIGHT] = 0.1 #insert disc into the doc doc.InsertObject(disc_obj) doc.AddUndo(c4d.UNDOTYPE_NEW, disc_obj) #insert poly_obj under disc poly_obj.InsertUnder(disc_obj) doc.AddUndo(c4d.UNDOTYPE_NEW, poly_obj) def main(): path = "F:\\test.csv" doc.StartUndo() with open(path, 'rb') as csv_file: readed = csv.DictReader(csv_file, delimiter=',') for i, row in enumerate(readed): try: name = str(row["ObjectName"]) r_h = float(row["R.H"][:-1]) #-1 for removing ° depand of the encoding of the file can be -2 p_x = float(row["P.X"]) p_y = float(row["P.Y"]) outer_radius = float(row["OuterRadius"]) except: print "Error while reading - {}".format(row) continue r_h = c4d.utils.Rad(r_h) #convert in radian since c4d handle rotation in radian add_mesh(i, name, r_h, p_x, p_y, outer_radius) c4d.EventAdd() doc.EndUndo() if __name__=='__main__': main() Here you got poly obj created and set to 0.1 height / weight
  6. Sometimes it's way more efficient to do thing dirtly :p Here is what you want in 3 min chrono ! :) http://recordit.co/RdoLnyjS32 I just change the script for make it save as obj instead of c4d files. import c4d import os def get_current_frame(): frame = int(doc.GetTime().GetFrame(doc.GetFps())) return str(frame).zfill(4) def save_obj(): save_path = "C:\\Users\graphos\\Desktop\\Nouveau dossier" path = str(os.path.join(save_path, "{}.obj".format(get_current_frame()))) c4d.documents.SaveDocument(doc, path,c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, 1030178) def main(): total_frame = 1 for i in xrange(total_frame): c4d.CallCommand(12236) # Make Editable save_obj() c4d.CallCommand(12105) # Undo c4d.CallCommand(12414) # Go to Next Frame c4d.EventAdd() if __name__=='__main__': main()
  7. Here a basic script. Note that there is no material asignation since I don't know if the script need to create them or grab it from the actual doc. #CSV Importer exemple by graphos #12/07/2017 import c4d import csv def add_mesh(num, name, r_h, p_x, p_y, outer_radius): #Create obj in memory disc_obj = c4d.BaseObject(c4d.Odisc) poly_obj = c4d.BaseObject(c4d.Opolygon) #Set obj names disc_obj.SetName("{}-Alpha {}".format(str(num).zfill(2), name)) poly_obj.SetName("{}-{}".format(str(num).zfill(2), name)) #Set disc_parameter disc_obj[c4d.PRIM_DISC_ORAD] = outer_radius disc_obj[c4d.ID_BASEOBJECT_REL_ROTATION,c4d.VECTOR_X] = r_h disc_obj[c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_X] = p_x disc_obj[c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_Y] = p_y #remove visiblity for poly_obj poly_obj[c4d.ID_BASEOBJECT_VISIBILITY_RENDER] = 1 #insert disc into the doc doc.InsertObject(disc_obj) doc.AddUndo(c4d.UNDOTYPE_NEW, disc_obj) #insert poly_obj under disc poly_obj.InsertUnder(disc_obj) doc.AddUndo(c4d.UNDOTYPE_NEW, poly_obj) def main(): path = "F:\\test.csv" doc.StartUndo() with open(path, 'rb') as csv_file: readed = csv.DictReader(csv_file, delimiter=',') for i, row in enumerate(readed): try: name = str(row["ObjectName"]) r_h = float(row["R.H"][:-1]) #-1 for removing ° depand of the encoding of the file can be -2 p_x = float(row["P.X"]) p_y = float(row["P.Y"]) outer_radius = float(row["OuterRadius"]) except: print "Error while reading - {}".format(row) continue r_h = c4d.utils.Rad(r_h) #convert in radian since c4d handle rotation in radian add_mesh(i, name, r_h, p_x, p_y, outer_radius) c4d.EventAdd() doc.EndUndo() if __name__=='__main__': main()
  8. We are not wizard, if you don't give us the informations you get and how they are exactly formatted we can't help you.
  9. Yes you can do it pretty easily can you provide how the csv is build?
  10. I would like to add you also get the possibility to use the correction deformer for make custom selection ! ;) I have made a quick tutorial for showing it !
  11. Here a quick script with both compatibility I also added another version more precise. Just change nb_point = 200 for a more precise gradient gradient_to_spline.c4d
  12. Take a look at my project here https://github.com/gr4ph0s/RefractiveIndex-Importer/ More specially https://github.com/gr4ph0s/RefractiveIndex-Importer/blob/master/res/src/Ui.py#L59 who cconvert a SplineData to a GradientData
  13. You are 100% right about a possibility of a bug because even if we set the cloner as default in object mode is not well initizialized as object mode. So there must be something wrong or at least you have to pass a special Message to the cloner for update his UI. So I encourage you to post at http://www.plugincafe.com/forum/forum_topics.asp?FID=3 where you can have an official reply. And post a sample code it will help developper to help you ;) import c4d def main(): cloner = c4d.BaseObject(1018544) doc.InsertObject(cloner) #Set mode cloner[c4d.ID_MG_MOTIONGENERATOR_MODE] = 0 cloner[c4d.MG_POLY_MODE_] = 3 #insert Animation count = c4d.CTrack(cloner, c4d.DescID(c4d.MG_POLYSURFACE_COUNT)) cloner.InsertTrackSorted(count) c4d.EventAdd() if __name__=='__main__': main()
  14. Just count = c4d.CTrack(op, c4d.DescID(c4d.MG_POLYSURFACE_COUNT)) op.InsertTrackSorted(count) c4d.EventAdd()
  15. It's a free tag plugin who allow you to import refrective index data (k and n) into curve. It's free and open source ! Feel free to share it where you want as long as you give credit. Any feedback, suggestion is welcome too. Here the preview demo: For more informations: https://gr4ph0s.github.io/RefractiveIndex-Importer/ For programmer it's was funny to do since I approche UI in a very different way that normally you should do. I firstly thinked about making it aviable in a Gedialog but since user can't copy/paste SplineData directly from the UI it's suck. So I moved to a python tag. Unfortually Dynamic description are only for R18+. So I decide to dont use it for more compatibility. Hope you enjoy it ! :)