So far we have focused on using python to manipulate 3D objects, but we can access all the other areas of blender with python as well. Patrick demonstrates how to modify and run operators in other window contexts such as the action editor and node editor.
- [Narrator] Now let's dive further…into the bpy.context and bpy.data modules.…Again, we're gonna switch to the scripting layout.…If I maximize this screen, using Control + Up,…we can then look at bpy.context,…as we had before,…and bpy.data.…One thing to note that may be convenient…is that the interactive Python console…comes with the convenience variables C and D, respectively.…You note, when I print these out,…they have the exact same data and connection…to the bpy context and data corresponding modules.…
In this video, we're gonna be using these…instead of having to type out bpy.context every time.…But just remember, in a script…if you ever want to use something like this,…you could, for example, type out…C = bpy.context…to be used the same way.…If I de-maximize this screen and then use C.object,…we can grab the active object in our scene.…If I just select another object in the scene,…then run the line again by pressing Up Arrow + Enter,…you see the changes in real time as you would expect.…
But what you may not necessarily realize…
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.