home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / share / k3d / scripts / bevel_points_with_selection.py next >
Text File  |  2008-07-27  |  803b  |  26 lines

  1. #python
  2.  
  3. import k3d
  4.  
  5. doc = Document
  6. doc.start_change_set()
  7.  
  8. cube = doc.new_node("PolyCube")
  9.  
  10. bevel_points = doc.new_node("BevelPoints")
  11. selection = k3d.deselect_all()
  12. selection.points = [(0, 4, 1), (4, 1000, 0)]
  13. bevel_points.mesh_selection = selection
  14.  
  15. mesh_instance = doc.new_node("MeshInstance")
  16. selection_node = Document.get_node_by_metadata("inode_selection", "ngui:unique_node", "node_selection")
  17. selection_node.select(mesh_instance, 1.0)
  18. mesh_instance.show_component_selection = True
  19. mesh_instance.gl_painter = doc.get_node("GL Default Painter")
  20.  
  21. doc.set_dependency(bevel_points.get_property("input_mesh"), cube.get_property("output_mesh"))
  22. doc.set_dependency(mesh_instance.get_property("input_mesh"), bevel_points.get_property("output_mesh"))
  23.  
  24. doc.finish_change_set("Create Cube with 4 Bevels")
  25.  
  26.