user: Show practical ways to work with Bpy.Ops.Object in a Blender add-on or script – include code.

assistant: he random generator use_delta ( boolean , ( optional ) ) – Transform Delta, Randomize delta transform values instead of regular transform use_loc ( boolean , ( optional ) ) – Randomize Location, Randomize the location values loc ( mathutils.Vector of 3 items in [-100, 100], (optional)) – Location, Maximum distance the objects can spread over each axis use_rot ( boolean , ( optional ) ) – Randomize Rotation, Randomize the rotation values rot ( mathutils.Euler rotation of 3 items in [-3.14159, 3.14159], (optional)) – Rotation, Maximum rotation over each axis use_scale ( boolean , ( optional ) ) – Randomize Scale, Randomize the scale values scale_even ( boolean , ( optional ) ) – Scale Even, Use the same scale value for all axis scale ( float array of 3 items in [ -100 , 100 ] , ( optional ) ) – Scale, Maximum scale randomization over each axis File : startup/bl_operators/object_randomize_transform.py:161 bpy.ops.object. reset_override_library ( ) ¶ Reset the selected local overrides to their linked references values bpy.ops.object. rotation_clear ( * , clear_delta = False ) ¶ Clear the object’s rotation Parameters : clear_delta ( boolean , ( optional ) ) – Clear Delta, Clear delta rotation in addition to clearing the normal rotation transform bpy.ops.object. scale_clear ( * , clear_delta = False ) ¶ Clear the object’s scale Parameters : clear_delta ( boolean , ( optional ) ) – Clear Delta, Clear delta scale in addition to clearing the normal scale transform bpy.ops.object. select_all ( * , action = 'TOGGLE' ) ¶ Change selection of all visible objects in scene Parameters : action (enum in [ 'TOGGLE' , 'SELECT' , 'DESELECT' , 'INVERT' ], (optional)) – Action, Selection action to execute TOGGLE Toggle – Toggle selection for all elements. SELECT Select – Select all elements. DESELECT Deselect – Deselect all elements. INVERT Invert – Invert selection of all elements. bpy.ops.object. select_by_type ( * , extend = False , type = 'MESH' ) ¶ Select all visible objects that are of a type Parameters : extend ( boolean , ( optional ) ) – Extend, Extend selection instead of deselecting everything first type (enum in Object Type Items , (optional)) – Type bpy.ops.object. select_camera ( * , extend = False ) ¶ Select the active camera Parameters : extend ( boolean , ( optional ) ) – Extend, Extend the selection File : startup/bl_operators/object.py:122 bpy.ops.object. select_grouped ( * , extend = False , type = 'CHILDREN_RECURSIVE' ) ¶ Select all visible objects grouped by various properties Parameters : extend ( boolean , ( optional ) ) – Extend, Extend selection instead of deselecting everything first type (enum in [ 'CHILDREN_RECURSIVE' , 'CHILDREN' , 'PARENT' , 'SIBLINGS' , 'TYPE' , 'COLLECTION' , 'HOOK' , 'PASS' , 'COLOR' , 'KEYINGSET' , 'LIGHT_TYPE' ], (optional)) – Type CHILDREN_RECURSIVE Children. CHILDREN Immediate Children. PARENT Parent. SIBLINGS Siblings – Shared parent. TYPE Type – Shared object type. COLLECTION Collection – Shared collection. HOOK Hook. PASS Pass – Render pass index. COLOR Color – Object color. KEYINGSET Keying Set – Objects included in active Keying Set. LIGHT_TYPE Light Type – Matching light types. bpy.ops.object. select_hierarchy ( * , direction = 'PARENT' , extend = False ) ¶ Select object relative to the active object’s position in the hierarchy Parameters : direction (enum in [ 'PARENT' , 'CHILD' ], (optional)) – Direction, Direction to select in the hierarchy extend ( boolean , ( optional ) ) – Extend, Extend the existing selection File : startup/bl_operators/object.py:172 bpy.ops.object. select_less ( ) ¶ Deselect objects at the boundaries of parent/child relationships bpy.ops.object. select_linked ( * , extend = False , type = 'OBDATA' ) ¶ Select all visible objects that are linked Parameters : extend ( boolean , ( optional ) ) – Extend, Extend selection instead of deselecting everything first type (enum in [ 'OBDATA' , 'MATERIAL' , 'DUPGROUP' , 'PARTICLE' , 'LIBRARY' , 'LIBRARY_OBDATA' ], (optional)) – Type bpy.ops.object. select_mirror ( * , extend = False ) ¶ Select the mirror objects of the selected object e.g. “L.sword” and “R.sword” Parameters : extend ( boolean , ( optional ) ) – Extend, Extend selection instead of deselecting everything first bpy.ops.object. select_more ( ) ¶ Select connected parent/child objects bpy.ops.object. select_pattern ( * , pattern = '*' , case_sensitive = False , extend = True ) ¶ Select objects matching a naming pattern Parameters : pattern ( string , ( optional , never None ) ) – Pattern, Name filter using ‘*’, ‘?’ and ‘[abc]’ unix style wildcards case_sensitive ( boolean , ( optional ) ) – Case Sensitive, Do a case sensitive compare extend ( boolean , ( optional ) ) – Extend, Extend the existing selection File : startup/bl_operators/object.py:45 bpy.ops.object. select_random ( * , ratio = 0.5 , seed = 0 , action = 'SELECT' ) ¶ Select or deselect random visible objects Parameters : ratio ( float in [ 0 , 1 ] , ( optional ) ) – Ratio, Portion of items to select randomly seed ( int in [ 0 , inf ] , ( optional ) ) – Random Seed, Seed for the random number generator action (enum in [ 'SELECT' , 'DESELECT' ], (optional)) – Action, Selection action to execute SELECT Select – Select all elements. DESELECT Deselect – Deselect all elements. bpy.ops.object. select_same_collection ( * , collection = '' ) ¶ Select object in the same collection Parameters : collection ( string , ( optional , never None ) ) – Collection, Name of the collection to select bpy.ops.object. shade_auto_smooth ( * , use_auto_smooth = True , angle = 0.523599 ) ¶ Add modifier to automatically set the sharpness of mesh edges based on the angle between the neighboring faces Parameters : use_auto_smooth ( boolean , ( optional ) ) – Auto Smooth, Add modifier to set edge sharpness automatically angle ( float in [ 0 , 3.14159 ] , ( optional ) ) – Angle, Maximum angle between face normals that will be considered as smooth bpy.ops.object. shade_flat ( * , keep_sharp_edges = True ) ¶ Render and display faces uniform, using face normals Parameters : keep_sharp_edges ( boolean , ( optional ) ) – Keep Sharp Edges, Don’t remove sharp edges, which are redundant with faces shaded smooth bpy.ops.object. shade_smooth ( * , keep_sharp_edges = True ) ¶ Render and display faces smooth, using interpolated vertex normals Parameters : keep_sharp_edges ( boolean , ( optional ) ) – Keep Sharp Edges, Don’t remove sharp edges. Tagged edges will remain sharp bpy.ops.object. shade_smooth_by_angle ( * , angle = 0.523599 , keep_sharp_edges = True ) ¶ Set the sharpness of mesh edges based on the angle between the neighboring faces Parameters : angle ( float in [ 0 , 3.14159 ] , ( optional ) ) – Angle, Maximum angle between face normals that will be considered as smooth keep_sharp_edges ( boolean , ( optional ) ) – Keep Sharp Edges, Only add sharp edges instead of clearing existing tags first bpy.ops.object. shaderfx_add ( * , type = 'FX_BLUR' ) ¶ Add a visual effect to the active object Parameters : type (enum in Object Shaderfx Type Items , (optional)) – Type bpy.ops.object. shaderfx_copy ( * , shaderfx = '' ) ¶ Duplicate effect at the same position in the stack Parameters : shaderfx ( string , ( optional , never None ) ) – Shader, Name of the shaderfx to edit bpy.ops.object. shaderfx_move_down ( * , shaderfx = '' ) ¶ Move effect down in the stack Parameters : shaderfx ( string , ( optional , never None ) ) – Shader, Name of the shaderfx to edit bpy.ops.object. shaderfx_move_to_index ( * , shaderfx = '' , index = 0 ) ¶ Change the effect’s position in the list so it evaluates after the set number of others Parameters : shaderfx ( string , ( optional , never None ) ) – Shader, Name of the shaderfx to edit index ( int in [ 0 , inf ] , ( optional ) ) – Index, The index to move the effect to bpy.ops.object. shaderfx_move_up ( * , shaderfx = '' ) ¶ Move effect up in the stack Parameters : shaderfx ( string , ( optional , never None ) ) – Shader, Name of the shaderfx to edit bpy.ops.object. shaderfx_remove ( * , shaderfx = '' , report = False ) ¶ Remove a effect from the active Grease Pencil object Parameters : shaderfx ( string , ( optional , never None ) ) – Shader, Name of the shaderfx to edit report ( boolean , ( optional ) ) – Report, Create a notification after the operation bpy.ops.object. shape_key_add ( * , from_mix = True ) ¶ Add shape key to the object Parameters : from_mix ( boolean , ( optional ) ) – From Mix, Create the new shape key from the existing mix of keys bpy.ops.object. shape_key_clear ( ) ¶ Reset the weights of all shape keys to 0 or to the closest value respecting the limits bpy.ops.object. shape_key_copy ( ) ¶ Duplicate the active shape key bpy.ops.object. shape_key_lock ( * , action = 'LOCK' ) ¶ Change the lock state of all shape keys of active object Parameters : action (enum in [ 'LOCK' , 'UNLOCK' ], (optional)) – Action, Lock action to execute on vertex groups LOCK Lock – Lock all shape keys. UNLOCK Unlock – Unlock all shape keys. bpy.ops.object. shape_key_make_basis ( ) ¶ Make this shape key the new basis key, effectively applying it to the mesh. Note that this applies the shape key at its 100% value bpy.ops.object. shape_key_mirror ( * , use_topology = False ) ¶ Mirror the current shape key along the local X axis Parameters : use_topology ( boolean , ( optional ) ) – Topology Mirror, Use topology based mirroring (for when both sides of mesh have matching, unique topology) bpy.ops.object. shape_key_move ( * , type = 'TOP' ) ¶ Move selected shape keys up/down in the list Parameters : type (enum in [ 'TOP' , 'UP' , 'DOWN' , 'BOTTOM' ], (optional)) – Type TOP Top – Top of the list. UP Up. DOWN Down. BOTTOM Bottom – Bottom of the list. bpy.ops.object. shape_key_remove ( * , all = False , apply_mix = False ) ¶ Remove shape key from the object Parameters : all ( boolean , ( optional ) ) – All, Remove all shape keys apply_mix ( boolean , ( optional ) ) – Apply Mix, Apply current mix of shape keys to the geometry before removing them bpy.ops.object. shape_key_retime ( ) ¶ Resets the timing for absolute shape keys bpy.ops.object. shape_key_transfer ( * , mode = 'OFFSET' , use_clamp = False ) ¶ Copy the active shape key of another selected object to this one Parameters : mode (enum in [ 'OFFSET' , 'RELATIVE_FACE' , 'RELATIVE_EDGE' ], (optional)) – Transformation Mode, Relative shape positions to the new shape method OFFSET Offset – Apply the relative positional offset. RELATIVE_FACE Relative Face – Calculate relative position (using faces). RELATIVE_EDGE Relative Edge – Calculate relative position (using edges). use_clamp ( boolean , ( optional ) ) – Clamp Offset, Clamp the transformation to the distance each vertex moves in the original shape File : startup/bl_operators/object.py:502 bpy.ops.object. simulation_nodes_cache_bake ( * , selected = False ) ¶ Bake simulations in geometry nodes modifiers Parameters : selected ( boolean , ( optional ) ) – Selected, Bake cache on all selected objects bpy.ops.object. simulation_nodes_cache_calculate_to_frame ( * , selected = False ) ¶ Calculate simulations in geometry nodes modifiers from the start to current frame Parameters : selected ( boolean , ( optional ) ) – Selected, Calculate all selected objects instead of just the active object bpy.ops.object. simulation_nodes_cache_delete ( * , selected = False ) ¶ Delete cached/baked simulations in geometry nodes modifiers Parameters : selected ( boolean , ( optional ) ) – Selected, Delete cache on all selected objects bpy.ops.object. skin_armature_create ( * , modifier = '' ) ¶ Create an armature that parallels the skin layout Parameters : modifier ( string , ( optional , never None ) ) – Modifier, Name of the modifier to edit bpy.ops.object. skin_loose_mark_clear ( * , action = 'MARK' ) ¶ Mark/clear selected vertices as loose Parameters : action (enum in [ 'MARK' , 'CLEAR' ], (optional)) – Action MARK Mark – Mark selected vertices as loose. CLEAR Clear – Set selected vertices as not loose. bpy.ops.object. skin_radii_equalize ( ) ¶ Make skin radii of selected vertices equal on each axis bpy.ops.object. skin_root_mark ( ) ¶ Mark selected vertices as roots bpy.ops.object. speaker_add ( * , enter_editmode = False , align = 'WORLD' , location = (0.0, 0.0, 0.0) , rotation = (0.0, 0.0, 0.0) , scale = (0.0, 0.0, 0.0) ) ¶ Add a speaker object to the scene Parameters : enter_editmode ( boolean , ( optional ) ) – Enter Edit Mode, Enter edit mode when adding this object align (enum in [ 'WORLD' , 'VIEW' , 'CURSOR' ], (optional)) – Align, The alignment of the new object WORLD World – Align the new object to the world. VIEW View – Align the new object to the view. CURSOR 3D Cursor – Use the 3D cursor orientation for the new object. location ( mathutils.Vector of 3 items in [-inf, inf], (optional)) – Location, Location for the newly added object rotation ( mathutils.Euler rotation of 3 items in [-inf, inf], (optional)) – Rotation, Rotation for the newly added object scale ( mathutils.Vector of 3 items in [-inf, inf], (optional)) – Scale, Scale for the newly added object bpy.ops.object. subdivision_set ( * , level = 1 , relative = False , ensure_modifier = True ) ¶ Sets a Subdivision Surface level (1 to 5) Parameters : level ( int in [ -100 , 100 ] , ( optional ) ) – Level relative ( boolean , ( optional ) ) – Relative, Apply the subdivision surface level as an offset relative to the current level ensure_modifier ( boolean , ( optional ) ) – Ensure Modifier, Create the corresponding modifier if it does not exist File : startup/bl_operators/object.py:245 bpy.ops.object. surfacedeform_bind ( * , modifier = '' ) ¶ Bind mesh to target in surface deform modifier Parameters : modifier ( string , ( optional , never None ) ) – Modifier, Name of the modifier to edit bpy.ops.object. text_add ( * , radius = 1.0 , enter_editmode = False , align = 'WORLD' , location = (0.0, 0.0, 0.0) , rotation = (0.0, 0.0, 0.0) , scale = (0.0, 0.0, 0.0) ) ¶ Add a text object to the scene Parameters : radius ( float in [ 0 , inf ] , ( optional ) ) – Radius enter_editmode ( boolean , ( optional ) ) – Enter Edit Mode, Enter edit mode when adding this object align (enum in [ 'WORLD' , 'VIEW' , 'CURSOR' ], (optional)) – Align, The alignment of the new object WORLD World – Align the new object to the world. VIEW View – Align the new object to the view. CURSOR 3D Cursor – Use the 3D cursor orientation for the new object. location ( mathutils.Vector of 3 items in [-inf, inf], (optional)) – Location, Location for the newly added object rotation ( mathutils.Euler rotation of 3 items in [-inf, inf], (optional)) – Rotation, Rotation for the newly added object scale ( mathutils.Vector of 3 items in [-inf, inf], (optional)) – Scale, Scale for the newly added object bpy.ops.object. track_clear ( * , type = 'CLEAR' ) ¶ Clear tracking constraint or flag from object Parameters : type (enum in [ 'CLEAR' , 'CLEAR_KEEP_TRANSFORM' ], (optional)) – Type bpy.ops.object. track_set ( * , type = 'DAMPTRACK' ) ¶ Make the object track another object, using various methods/constraints Parameters : type (enum in [ 'DAMPTRACK' , 'TRACKTO' , 'LOCKTRACK' ], (optional)) – Type bpy.ops.object. transfer_mode ( * , use_flash_on_transfer = True ) ¶ Switches the active object and assigns the same mode to a new one under the mouse cursor, leaving the active mode in the current one Parameters : use_flash_on_transfer ( boolean , ( optional ) ) – Flash On Transfer, Flash the target object when transferring the mode bpy.ops.object. transform_apply ( * , location = True , rotation = True , scale = True , properties = True , isolate_users = False ) ¶ Apply the object’s transformation to its data Parameters : location ( boolean , ( optional ) ) – Location rotation ( boolean , ( optional ) ) – Rotation scale ( boolean , ( optional ) ) – Scale properties ( boolean , ( optional ) ) – Apply Properties, Modify properties such as curve vertex radius, font size and bone envelope isolate_users ( boolean , ( optional ) ) – Isolate Multi User Data, Create new object-data users if needed bpy.ops.object. transform_axis_target ( ) ¶ Interactively point cameras and lights to a location (Ctrl translates) bpy.ops.object. transform_to_mouse ( * , name = '' , session_uid = 0 , matrix = ((0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.0)) , drop_x = 0 , drop_y = 0 ) ¶ Snap selected item(s) to the mouse location Parameters : name ( string , ( optional , never None ) ) – Name, Object name to place (uses the active object when this and ‘session_uid’ are unset) session_uid ( int in [ -inf , inf ] , ( optional ) ) – Session UUID, Session UUID of the object to place (uses the active object when this and ‘name’ are unset) matrix ( mathutils.Matrix of 4 * 4 items in [-inf, inf], (optional)) – Matrix drop_x ( int in [ -inf , inf ] , ( optional ) ) – Drop X, X-coordinate (screen space) to place the new object under drop_y ( int in [ -inf , inf ] , ( optional ) ) – Drop Y, Y-coordinate (screen space) to place the new object under bpy.ops.object. transforms_to_deltas ( * , mode = 'ALL' , reset_values = True ) ¶ Convert normal object transforms to delta transforms, any existing delta transforms will be included as well Parameters : mode (enum in [ 'ALL' , 'LOC' , 'ROT' , 'SCALE' ], (optional)) – Mode, Which transforms to transfer ALL All Transforms – Transfer location, rotation, and scale transforms. LOC Location – Transfer location transforms only. ROT Rotation – Transfer rotation transforms only. SCALE Scale – Transfer scale transforms only. reset_values ( boolean , ( optional ) ) – Reset Values, Clear transform values after transferring to deltas File : startup/bl_operators/object.py:764 bpy.ops.object. unlink_data ( ) ¶ Undocumented, consider contributing . bpy.ops.object. update_shapes ( * , use_mirror = False ) ¶ Update existing shape keys with the vertex positions of selected objects with matching names Parameters : use_mirror ( boolean ,