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.…
AuthorPatrick W. Crawford
- 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
1. Controlling Blender through Code
2. Create Blender Scripts
3. Customize Blender Interfaces
4. Build Your Own Add-On
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.Cancel
Take 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.