Get the latest Blender, older versions, or experimental builds.
Stay up-to-date with the new features in the latest Blender releases.
Access production assets and knowledge from the open movies.
Documentation on the usage and features in Blender.
Latest development updates, by Blender developers.
Guidelines, release notes and development docs.
A platform to collect and share results of the Blender Benchmark.
The yearly event that brings the community together.
Support core development with a monthly contribution.
Perform a single donation with more payment options available.
Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.
# Example of a gizmo that activates an operator
# using the predefined dial gizmo to change the camera roll.
#
# Usage: Run this script and select a camera in the 3D view.
import bpy
from bpy.types import (
GizmoGroup,
)
class MyCameraWidgetGroup(GizmoGroup):
bl_idname = "OBJECT_GGT_test_camera"
bl_label = "Object Camera Test Widget"
bl_space_type = 'VIEW_3D'
bl_region_type = 'WINDOW'
bl_options = {'3D', 'PERSISTENT'}
@classmethod
def poll(cls, context):
ob = context.object
return (ob and ob.type == 'CAMERA')
def setup(self, context):
# Run an operator using the dial gizmo
gz = self.gizmos.new("GIZMO_GT_dial_3d")
props = gz.target_set_operator("transform.rotate")
props.constraint_axis = False, False, True
props.orient_type = 'LOCAL'
props.release_confirm = True
gz.matrix_basis = ob.matrix_world.normalized()
gz.line_width = 3
gz.color = 0.8, 0.8, 0.8
gz.alpha = 0.5
gz.color_highlight = 1.0, 1.0, 1.0
gz.alpha_highlight = 1.0
self.roll_gizmo = gz
def refresh(self, context):
gz = self.roll_gizmo
bpy.utils.register_class(MyCameraWidgetGroup)