Jump to content

Masterpie

Limited Member
  • Posts

    175
  • Joined

  • Last visited

Everything posted by Masterpie

  1. Thank You and Thanks to Kalugin!
  2. Thanks for this but for me it's not working,even it's Hierarchical or not This is from Console: File "scriptmanager",line73,in <module> File "scriptmanager",line51, in main NameError:global name 'Onew' is not defined Do I have to specify something?
  3. Oh man,I'm so dumb sometimes,of course: I first had to do what you said ,and then run the script Thanks very much!
  4. I have many splines and I want to put each spline in an extrude object. I'm aware of the Extrude Hierarchical option. In fact my problem is related to Edit-Optimize script from the PixelLab.The script was initially set just for one Extrude object,but someone has improved it to work with multiple objects,as you can see in the comments from the script website page https://www.thepixellab.net/editoptimize-free-c4d-script#comment-29203 But the problem is,that if you have many splines grouped in one Extrude object ,then the script will make just one editable object,but i need to produce separate editable objects from each of the splines. If you have each spline in a separate Extrude object then the script will create separate editable objects. That's why i wonder if there is a way to assign an Extrude object to each of the splines. Or if somebody knows how to improve the script to work in that way,would be awesome! Here is the script: """ Group Each adamalbo respect to bretbays Name-US: join command Description-US: makes youre object editable """ import c4d from c4d import gui def main(): doc.StartUndo() sel=doc.GetSelection() for x in sel: co=c4d.BaseObject(1011010) doc.AddUndo(c4d.UNDOTYPE_CHANGE, x) xPos=x.GetMg() xPosL=x.GetMl() null=co name=x.GetName()+ str ("_algn") doc.AddUndo(c4d.UNDOTYPE_NEW, null) null.SetName(name) doc.InsertObject(null, None, x) null.SetMg(xPos) doc.SetSelection(null, c4d.SELECTION_ADD) doc.SetSelection(x, c4d.SELECTION_SUB) x.InsertUnder(null) x.SetMg(xPos) c4d.CallCommand(12236) doc.SetSelection(null, c4d.SELECTION_ADD) null.SetPhong(True,True,c4d.utils.Rad(80)) doc.EndUndo() c4d.EventAdd() if __name__=='__main__': main()
  5. Yes that it's working for multiple objects,good job! I would check that link about polygon selection Thank You Very Much!
  6. Yes that it's indeed my problem - I want to select the polygons i want through script,not manually,but i don't know how,and I wanted it on multiple objects
  7. I have this code for extruding all the polygons for the selected objects import c4d from c4d import utils settings = c4d.BaseContainer() # Settings settings[c4d.MDATA_EXTRUDE_OFFSET] = 50.0 # Length of the extrusion res = utils.SendModelingCommand(command = c4d.ID_MODELING_EXTRUDE_TOOL, list = [op], mode = c4d.MODELINGCOMMANDMODE_POLYGONSELECTION, bc = settings, doc = doc) c4d.EventAdd() if res is False: print "Something went wrong." elif res is True: print "Command successfull." elif isinstance(res, list): print "Here you get the newly created object(s)." I have it from here https://developers.MAXON.net/docs/Cinema4DPythonSDK/html/modules/c4d.utils/index.html#c4d.utils.SendModelingCommand I want that extrude to function only on certain polygon.For example i have a bunch of cubes and i want to extrude only the top polygons. I know that it's working if you select manually those top polygons you wish to be extruded,but i want those top polygons to be selected by script(maybe by their index) and then extruded. EDIT: Now I see that it's working only on one object at a time;I mean if you select more objects at once it will not working So is it possible what i want?
  8. Thank You very much,it's working but there again is a problem for me because in fact those cubes are some extruded splines so i cannot add segment. My mistake,maybe i should have mentioned this from the beginning I've tried to subdivide the extrude after I made it editable but it's not working,there are more polygons
  9. Ok someone else helped me,look here http://www.plugincafe.com/forum/forum_posts.asp?TID=13182&PID=52172#52172 still some missing steps for me (that what i wrote in the second to last post there) but it's awesome only that If you know to develop it further I would be more than happy! I would try to see what i can do,but nothing promising from me
  10. Ok Thank You,i get what you say,but i unfortunately i don't know how to apply it I've tried it in the script manager like you said - i put these 2 new lines of code and then the code from previous post but nothing happens do i have to write something else also?,because i really don't know Python
  11. ok brilliant!,we're getting somewhere now :) i wanted this to work on multiple objects and it can,you just have to group all the objects you need in a null apply the python tag to the null and then,right click - copy to children The problem is that i want those points to weld them,but separately on each cube like this but now it welds all the points together and then another problem is that if we are suppose that it welds,like i want(separately on each cube) then the problem is that after it welds first 2 points,"wrong" points remains selected(i suppose the next in the list) like you can see in the first picture on the welded cube but i want,after the first 2 points was welded then this 2 points(from the opposite edge) to be welded In fact i want to transform those cubes in shapes like these,but automatically
  12. ok thanks,but did you try it,it is working? because i've tried it with the python tag but maybe i'm doing something wrong. it says it's a syntax error in this line PointList=[1,3,7] i'm sorry but i'm very newbie with python
  13. yes but this is only for getting the index of those points,which you have to select it manually first,isnt'it? i want those points to be selected by the script itself i found this but it's not working for me and i don't know why,maybe some of you wants to check it too http://www.plugincafe.com/forum/forum_posts.asp?TID=10263&SID=143e9761c33c8aa15b1d285c7b4fde94
  14. Thanks but i wanted some automated way ...with Python/Coffee or Xpresso
  15. Is it possible to select specific points? On a cube i.e i want to select only 2 points. by index or somehow...
  16. Yes I'm aware of the House builder preset.I know it can do this stuff (pity for the roofs) but I was thinking about something in automated way like to be able to apply this to multiple objects,at once. These elements i.e doors,windows e.t.c can be the same size,in the same place like 2 windows and one door in middle on one of the 2 of the longest polygons I don't know know how complicated is these things to be done so maybe i'm asking too much. I don't know :) But if it's possible to make a roof on multiple simple rectangles at once - i'm happy just with that! I found this,maybe will help http://www.plugincafe.com/forum/forum_posts.asp?TID=10263&SID=143e9761c33c8aa15b1d285c7b4fde94
  17. First of all i even don't know if it's the right section of the Forum to post this... Here's what i want to achieve: I have a bunch of objects,like cubes,parallelepipeds and other extruded shapes in fact they are meant to be houses,but in this state(now) they are without roof I was wondering if anyone knows to make a script to add roof instantly to those shapes,it doesn't need to be necessarily complex or finished,if it's possible the better,but i'm happy with very simple roof also :),like these The process of modelling it requires just a few steps,as anyone knows,at least for the simplest one(from the left), 1.selecting the top polygon of the object 2.extruding it. 3.selecting the 2 top points from one of the polygons with smaller x value(at least on this model) 4.apply Weld command then other 2 steps ,the same for the other opposite polygon. Or if you can take it further and thinking about adding windows,doors or other elements,that would be really something.
×
×
  • Create New...