-
Notifications
You must be signed in to change notification settings - Fork 68
Objects
Created an empty object with the appropriate name
. If col
is provided, it will link the new object to that collection, otherwise it will link it to the active collection. Returns a reference to the newly created object.
Parameters :
- name* (String | Reference) : Name of object
- col (String | Reference) : Collection to be linked to
Returns : Object
Copies the provided tocopy
object and places the new copy in the col
collection. If the destination collection is not provided then it will put the new copy in the selected collection.
Parameters :
- tocopy* (String | Reference) : Object to be copied
- col (String | Reference) : Collection to be linked to
Returns : Copied Object
Convenience functions :
- duplicate_objects(tocopy, col)
Returns a reference to the active object in the scene. This is the equivalent of calling bpy.context.active_object
.
Returns : Object
Convenience functions :
- active_object()
- get_selected_object()
- selected_object()
- ao()
Returns a list of all selected objects, contained within bpy.context.selected_objects
.
Returns : Object List
Convenience functions :
- so()
- selected_objects()
Returns a list of all objects in the file, provided by bpy.data.objects
.
Returns : Object List
Convenience functions :
- get_list_of_objects()
Takes the provided ref
object and makes sure it is selected. If make_active
is given True
, then the object being selected will be made the actively selected object.
Parameters :
- ref* (String | Reference) : Name or reference of object
- make_active (boolean) : If true then object being selected will be made the active object. True by default
Selects all objects in the scene. If col
collection is provided, then it will only select the objects contained inside of that collection.
Parameters :
- col (String | Reference) : Collection reference to select objects from
Deselects the provided ref
object. Works only on single object
Parameters :
- ref* (String | Reference) : Name or reference of object
Deselects every object that is currently selected.
Deletes all objects that are selected, the equivalent of calling bpy.ops.object.delete()
.
Deletes the provided ref
object. Will delete active object if ref
not provided.
Parameters :
- ref (String | Reference) : Name or reference of object
Takes a list of objects (objlist
), deletes all of them.
Parameters :
- objlist* (List) : List of names or references of object
Creates an instance of the ref
object, gives it the name newname
and moves it to the col
collection (if provided).
Parameters :
- ref* (String | Reference) : Name or reference of object
- newname (String) : Name of new object
- col* (String | Reference) : Name or reference to collection
Returns : Object
Get the ref
object (can also be string name) and return a reference to it.
Works on single object. For multiple objects, use get_objects().
Will provide active object if reference not provided.
Parameters :
- ref* (String | Reference) : Name or reference of object
Returns : Object
Convenience functions :
- get_obj(ref)
Get reference to the list of objects. Will return a list of objects even if single object reference is passed.
ref
can be None, object, string name, list of names or list of objects.
Will provide list of all selected objects if reference is not provided.
Parameters :
- ref (String | Reference | List) : Name or reference of object/s
Returns : Object List
Convenience functions :
- get_objs(ref)
Will return the vector location of median point from all the list of objects.
objs
should be first passed through get_objects() to reduce errors.
Parameters :
- objs (List) : List of objects
Returns : Vector Location
Returns a true or false value depending on if the ref
object exists.
Parameters :
- ref* (String | Reference) : Name or reference of object
Returns : boolean
Renames the obj
object to newname
.
Parameters :
- obj* (String | Reference) : Name or reference of object
- newname* (String) : New name
Returns : None | False
Returns the parent of the ref
object.
Parameters :
- ref (String | Reference) : Name or reference of object
Returns : Object
Returns the children of the ref
object.
Parameters :
- ref (String | Reference) : Name or reference of object
Returns : Object list
Sets parent
to be the parent object of child
.
Parameters :
- child (String | Reference) : Name or reference of child object
- parent (String | Reference) : Name or reference of parent object
Clears the parent of the ref
object. keep_location
decides whether to maintain the global position of the object.
Parameters :
- ref (String | Reference) : Name or reference of object
- keep_location (boolean) : If object should retain its location. True by default
Returns the bounding box of an object.
Parameters :
- ref (String | Reference) : Name or reference of object
Returns : Bounding box
Returns the global coordinates of the corners of the bounding box of an object.
Parameters :
- ref (String | Reference) : Name or reference of object
Returns : Vector list
Converts the given ref
object to a mesh type.
Parameters :
- ref* (String | Reference) : Name or reference of object
Converts the given ref
object to a grease pencil type.
Parameters :
- ref* (String | Reference) : Name or reference of object
Converts the given ref
object to a curve type.
Parameters :
- ref* (String | Reference) : Name or reference of object
The equivalent of calling bpy.ops.object.select_by_type(type='MESH')
.
The equivalent of calling bpy.ops.object.select_by_type(type='CURVE')
.
The equivalent of calling bpy.ops.object.select_by_type(type='SURFACE')
.
The equivalent of calling bpy.ops.object.select_by_type(type='META')
.
The equivalent of calling bpy.ops.object.select_by_type(type='FONT')
.
The equivalent of calling bpy.ops.object.select_by_type(type='HAIR')
.
The equivalent of calling bpy.ops.object.select_by_type(type='POINTCLOUD')
.
The equivalent of calling bpy.ops.object.select_by_type(type='VOLUME')
.
The equivalent of calling bpy.ops.object.select_by_type(type='ARMATURE)
.
The equivalent of calling bpy.ops.object.select_by_type(type='LATTICE')
.
The equivalent of calling bpy.ops.object.select_by_type(type='EMPTY')
.
The equivalent of calling bpy.ops.object.select_by_type(type='GPENCIL')
.
The equivalent of calling bpy.ops.object.select_by_type(type='CAMERA')
.
The equivalent of calling bpy.ops.object.select_by_type(type='SPEAKER')
.
The equivalent of calling bpy.ops.object.select_by_type(type='LIGHT_PROBE')
.
The equivalent of calling bpy.ops.object.select_all(action='INVERT')
.
Returns a list of all objects that have modifiers attached to them.
Returns : Object list
Finds all objects with modifiers and sets their selection state to true.
Creates and returns a plane object.
Returns : Object
Creates and returns a cube object.
Returns : Object
Creates and returns a circle object.
Returns : Object
Creates and returns a cylinder object.
Returns : Object
Creates and returns a uv-sphere object.
Returns : Object
Convenience functions :
- create_sphere()
Creates and returns an ico-sphere object.
Returns : Object
Creates and returns a cone object.
Returns : Object
Creates and returns a torus object.
Returns : Object
Creates and returns a grid object.
Returns : Object
Creates and returns a suzanne object.
Returns : Object
Convenience functions :
- create_monkey()
Creates and returns a bezier curve object.
Returns : Object
Convenience functions :
- create_bezier
Creates and returns a circle curve object.
Returns : Object
Creates and returns a nurbs curve object.
Returns : Object
Creates and returns a nurbs curve circle object.
Returns : Object
Creates and returns a nurbs curve path object.
Returns : Object
Convenience functions :
- create_path()
Creates and returns a nurbs curve surface object.
Returns : Object
Convenience functions :
- create_curve_surface()
Creates and returns a nurbs circle surface object.
Returns : Object
Convenience functions :
- create_circle_surface()
Creates and returns a nurbs surface object.
Returns : Object
Creates and returns a nurbs cylinder surface object.
Returns : Object
Convenience functions :
- create_cylinder_surface
Creates and returns a nurbs sphere surface object.
Returns : Object
Convenience functions:
- create_sphere_surface
Creates and returns a nurbs torus surface object.
Returns : Object
Convenience functions :
- create_torus_surface()
Creates and returns a metaball object.
Returns : Object
Creates and returns a metaball capsule object.
Returns : Object
Creates and returns a metaball plane object.
Returns : Object
Creates and returns a metaball ellipsoid object.
Returns : Object
Creates and returns a metaball cube object.
Returns : Object
Creates and returns a text object.
Convenience functions:
- create_text()
Parameters :
- ref* (String | Reference) : Name or reference of object
Convenience functions :
- shade_smooth(ref)
Parameters :
- ref* (String | Reference) : Name or reference of object
Convenience functions :
- shade_flat(ref)
Check auuto smooth option and set angle limit to degrees
Parameters :
- ref* (String | Reference) : Name or reference of object
- degrees (int) : auto smooth angle. 60 by default