Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 7th, 2020 179 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import bpy
  2. import mathutils
  3. interp = mathutils.geometry.interpolate_bezier
  4.  
  5. class DummyOp(bpy.types.Operator):
  6.     bl_idname = "object.get_bezier"
  7.     bl_label = "Extract Bezier Points"
  8.  
  9.     def execute(self, context):
  10.         ob = context.object
  11.         dat = ob.data
  12.         bzp = dat.splines[0].bezier_points
  13.         points=interp(bzp[0].co, bzp[0].handle_right, bzp[1].handle_left, bzp[1].co, dat.resolution_u)
  14.         print(f"So far I can only extract this data:\n{dat.resolution_u},\nCurve points:")
  15.         for p in points:
  16.             print(p)
  17.         return {'FINISHED'}
  18.    
  19. def register():
  20.     bpy.utils.register_class(DummyOp)
  21.  
  22. def unregister():
  23.     bpy.utils.unregister_class(DummyOp)
  24.    
  25. if __name__ == "__main__":
  26.     register()
  27.    
  28.     bpy.ops.object.get_bezier()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top