Perhaps just as useful as defining your own custom panels is modifying the existing ones. If you have created a new tool or want a specific operator to be accessible in the same place as an existing panel, blender allows you to append more lines of the draw function to existing panels. It is important to understand how to properly register and un-register such panel modifications.
- [Instructor] One very useful thing you're also able to do…in Blender using Python is the append custom draw code…to existing panels.…Let's say for example that we are in the…Cycle Renders engine,…and then we want to have the Ray Visibility toggles…available under the Dimension panel.…Perhaps it's convenient for us to access it…in this one panel along with the Render settings.…Normally the Ray Visibility panel is available…under the World tab of the Properties window…under Ray Visibility.…Essentially what we can do is copy the code…from the Ray Visibility panel and paste it into a function…which we can then append to the draw function…of the Dimensions panel.…
To do this, let's first right-click one of the properties…in the Ray Visibility panel…and use Edit Source from the pop-up.…Then I'm going to convert the 3D view into a text editor.…From the data block pop-up, I'm going to select…the file that was created,…and I'm going to zoom in a little bit,…and then enable line numbering, word wrapping,…and highlighting.…
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.