This module goes over the components that define an operator and how it runs. Operators require class names and calling IDs for blender to use, and most importantly an execution function. This execution function is where the meat of the operator lives, it is the code that gets run when the operator's button is pressed.
- [Narrator] Let's now complete writing out the operator…which creates a smooth monkey.…Go into line 16,…where we started the template of the operator.…This first part here is a Blender convention…where you start out the name of the operator class…with the area or the type of operator it is.…In this case, related twin object.…The next thing we need to do…is add in the bpy.types. upper case Operator…so that this class can inherit the necessary properties.…Then don't forget to add the colon…at the end of the class line.…
I'm pressing enter.…By convention, we're going to add triple quoted descriptions…for what this operator does.…In this case, adds a smooth monkey to the 3D view.…Then there are two things that are required for an operator…very similar to a panel.…The first is a bl_label.…This is the human interface readable name of this operator.…"Add smooth monkey."…Next we have the bl_idname.…
This is how Blender refers to this operator,…such as when we want to draw this operator panel,…which name we have to pass in.…
Author
Released
9/15/2016- Controlling Blender with code
- Exploring the bpy library
- Creating Blender operators and properties
- Writing scripts
- Auto running scripts
- Drawing interface elements such as panels and menus
- Building a custom add-on
Skill Level Intermediate
Duration
Views
Related Courses
-
Blender Essential Training
with George Maestri9h 9m Beginner -
Python: Data Analysis
with Michele Vallisneri2h 16m Intermediate
-
Introduction
-
Welcome57s
-
-
1. Controlling Blender through Code
-
Importing and exploring bpy3m 25s
-
What's a Blender operator2m 27s
-
What's a Blender property2m 46s
-
2. Create Blender Scripts
-
Great coders steal3m 10s
-
Auto running scripts3m 45s
-
3. Customize Blender Interfaces
-
Panel structure7m 1s
-
Draw elements3m 58s
-
Append to existing panels5m 58s
-
Example menu structure5m 52s
-
4. Build Your Own Add-On
-
What's an add-on?2m 30s
-
What our add-on will do1m 35s
-
Appending to a menu5m 20s
-
-
Conclusion
-
Next steps1m 15s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Creating an operator framework