The functionality of operators can be extended by using blender properties, like those previously visited. Including these properties as input options for an add-on will automatically populate the redo-last menu also callable via F6. This is a way to have many more options for a given tool without complicating UI panels and using scene variables.
- [Narrator] Now let's continue and define the…redo last properties for our operator.…As a reminder, the three inputs…are smoothness, size and name.…First let's type out at the class level of our operator…the variable smoothness,…and then this will equal…bpy.props, which is short for properties,…and then IntProperty, where the I and P are capitalized.…This constructor has several required inputs.…
If I create an open parenthesis…and press enter and tab.…If I type out name = "Smoothness",…this is what the property will be named…in the user interface.…Then comma enter default = 2.…This is the default value of this integer property,…comma, enter,…and then give the description for this property.…In this case, this defines the "Subsurf level."…And then you're going to press enter and closed parentheses.…
Next you're going to press leap four times…go back to the class level of our operator…then define size, the next input.…Size = bpy.props.…Now it is a FloatProperty.…And the inputs, after I press tab…are name = "Size", enter,…
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.