Page Menu
Home
Search
Configure Global Search
Log In
Files
F9822073
SplineCenterOverride.txt
David Hill (davidwhill)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
David Hill (davidwhill)
Feb 20 2021, 5:37 PM
Size
1 KB
Subscribers
None
SplineCenterOverride.txt
View Options
import bpy
import math
from mathutils import Vector
# Create Bezier, select last control point, rotate about (0.0,1.0,0.0) using center_override option
bpy.ops.curve.primitive_bezier_curve_add(radius=1, enter_editmode=False, align='WORLD', location=(0, 0, 0))
bpy.ops.object.editmode_toggle()
bpy.ops.curve.select_all(action='DESELECT')
bpy.context.selected_objects[0].data.splines[0].bezier_points[1].select_control_point = True
center = Vector([0.0,1.0,0.0])
bpy.ops.transform.rotate(value=.3, orient_axis='Z', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(True, False, False), mirror=True, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False, center_override=(center))
# Create Bezier, select last control point, rotate without using center_override option
bpy.ops.object.editmode_toggle()
bpy.ops.curve.primitive_bezier_curve_add(radius=1, enter_editmode=False, align='WORLD', location=(0, 0, 0))
bpy.ops.object.editmode_toggle()
bpy.ops.curve.select_all(action='DESELECT')
bpy.context.selected_objects[0].data.splines[0].bezier_points[1].select_control_point = True
bpy.ops.transform.rotate(value=.3, orient_axis='Z', orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', constraint_axis=(True, False, False), mirror=True, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)
bpy.ops.object.editmode_toggle()
File Metadata
Details
Attached
Mime Type
text/x-python
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
54/ec/fb3dc978e3216b3670d70b44e1bd
Attached To
T85823: bpy.ops.transform.rotate() seems to ignore center_override when Bezier control points are selected
Event Timeline
Log In to Comment