Guest User

Untitled

a guest
Jun 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. #define selected object
  2. obj = bpy.context.active_object
  3.  
  4. #store current object to select again?
  5. object1 = obj
  6.  
  7.  
  8. # code so that I can move the origin of each empty
  9. # store the location of current 3d cursor
  10. #saved_location = bpy.context.scene.cursor_location.copy()
  11.  
  12. # give 3dcursor new coordinates
  13. #bpy.context.scene.cursor_location = (1.0,0.0,0.0)
  14.  
  15. # set the origin on the current object to the 3dcursor location
  16. #bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
  17.  
  18. #CREATE EMPTIES TO MANIPULATE ARRAYS
  19. #for i in range(int(context.scene.arry_amnt)):
  20. # i_amnt = i
  21. # e_mount = ("E" + str(i_amnt))
  22. # bpy.ops.object.text_add()
  23. # obt = bpy.context.object
  24. # obt.name = e_mount
  25. # obt.data.body = e_mount
  26. # obt.data.offset_y = i_amnt
  27. # obt.show_x_ray = True
  28. # obt.show_texture_space = True
  29. # obt.hide_render = True
  30.  
  31. # if context.scene.rnd_rotation == 1:
  32. # obt.rotation_euler[2] = random.randint(0,2)
  33.  
  34. # if context.scene.rnd_location == 1:
  35. # obt.location[2] = random.randint(0,2)
  36.  
  37. #ADD ARRAYS
  38. # p = obj.modifiers.new(name= "BLIX01", type='ARRAY')
  39. # p.use_relative_offset=False
  40. # p.use_object_offset=True
  41. # p.offset_object = bpy.data.objects[e_mount]
  42. # p.count = context.scene.arry_cnt
  43.  
  44. #how can i select the original object and unwarp / scale uv
  45. bpy.ops.mesh.select_all(action='DESELECT')
  46.  
  47. bpy.ops.object.select_all(action='TOGGLE')
  48.  
  49. object1.select = True
  50. bpy.ops.object.editmode_toggle()
  51.  
  52. bpy.ops.mesh.select_all(action='DESELECT')
  53. bpy.ops.mesh.select_mode(type='EDGE')
  54. bpy.ops.mesh.mark_seam(clear=False)
  55. bpy.ops.mesh.select_all(action='SELECT')
  56. bpy.ops.object.editmode_toggle()
  57. bpy.ops.uv.smart_project(angle_limit=30, island_margin=0.02, user_area_weight=0.03)
Add Comment
Please, Sign In to add comment