Blender Cloud
Films Training Blog Libraries Services
search Login Join Blender Cloud
Films
Training
Blog
Libraries
Services
Search
Login
Join

Course

Scripting for Artists

insert_drive_file Course Overview
Videos keyboard_arrow_down
  1. 01

    1: Introduction & copy-pasting

    lock_open
  2. 02

    2: Names & Objects

  3. 03

    3: Stuff on Lists

  4. 04

    4: Data Types

  5. 05

    5: Collections: Mass-Rename of Objects

  6. 06

    6: Blender Collections

    lock_open
  7. 07

    7: For vs. While

    lock_open
  8. 08

    8: Your Own Operator

    lock_open
  9. 09

    9: From Script to Add-on

    lock_open
  10. 10

    10: User Interfaces

    lock_open
  11. 11

    11: Custom Properties

    lock_open
  12. 12

    12: Asset Linking

    lock_open
  13. 13

    13: Roast my Add-on

    lock_open
  14. 14

    14: The Roast of Nature Clicker

    lock_open
  15. 15

    15: Modal Operators

    lock_open
  16. 16

    Tech 1: Updating F-Curves

  17. 17

    Tech 2: Render 10,000 OBJ files

  18. 18

    Tech 3: Mass-Rename Bones & Vertex Groups

  19. 19

    Tech 4: Rendering from 'all' angles

Course

Scripting for Artists

insert_drive_file Course Overview
Videos keyboard_arrow_down
  1. 01

    1: Introduction & copy-pasting

    lock_open
  2. 02

    2: Names & Objects

  3. 03

    3: Stuff on Lists

  4. 04

    4: Data Types

  5. 05

    5: Collections: Mass-Rename of Objects

  6. 06

    6: Blender Collections

    lock_open
  7. 07

    7: For vs. While

    lock_open
  8. 08

    8: Your Own Operator

    lock_open
  9. 09

    9: From Script to Add-on

    lock_open
  10. 10

    10: User Interfaces

    lock_open
  11. 11

    11: Custom Properties

    lock_open
  12. 12

    12: Asset Linking

    lock_open
  13. 13

    13: Roast my Add-on

    lock_open
  14. 14

    14: The Roast of Nature Clicker

    lock_open
  15. 15

    15: Modal Operators

    lock_open
  16. 16

    Tech 1: Updating F-Curves

  17. 17

    Tech 2: Render 10,000 OBJ files

  18. 18

    Tech 3: Mass-Rename Bones & Vertex Groups

  19. 19

    Tech 4: Rendering from 'all' angles

Videos

10: User Interfaces

17th April 2020

info License: CC-BY

lock_open Free

Download (98.0 MB)
flag Report Problem

Author

Sybren A. Stüvel

Buttons, panels, and menus. In this chapter of Scripting for Artists, Sybren shows the basics of creating your own user interface in Blender.

  • Finding existing UI code: 00:55
  • Ingredients of a Panel: 01:42
  • Different import styles: 03:00
  • Monkey Grid panel: 04:09
  • Adding operator buttons: 06:03
  • Basic layout tweaks: 09:21
  • Adding scene and object properties: 10:20
  • Conditional drawing: 13:26
  • Adding operators to menus: 15:30

4 Comments

Join to comment publicly.

Samuel Bernou

19th April 2020 - 13:39

A very clear and resourceful video. Even after making 30+ addons I learned a few things. e.g: I will certainly use columns starting now ;), thanks Doc.

Tijm Lanjouw

20th July 2020 - 13:15

Thanks for the tutorial. But how do I make the x, y and size values be defined by user input in the panel? I tried:

    def draw(self, context): #draw panel
        col = self.layout.column(align=True)
        props = col.operator('mesh.monkey_grid',
            text = 'Generate Grid',
            icon = 'MONKEY')

        col.label(text="Column Two:")
        col.prop(props, 'count_x')
        col.prop(props, 'count_y')
        col.prop(props, 'size')

The fields with the default paramaters show up in the panel, but I'm not able to change them. My guess is that I have to work with variables. I tried a couple of things, but I failed. Anyone?

Sybren A. Stüvel

4th August 2020 - 15:53

*@Tijm Lanjouw* You have to define the user-editable properties somewhere else. If they are to be saved within the blend file, you typically would add them to bpy.types.Scene. If they are temporary, you typically add them to bpy.types.WindowManager. You can then use them to assign for example props.count_x = context.scene.my_monkey_grid_count_x.

You cannot use operator properties with layout.prop().

Ludwig Heijden

2nd January 2021 - 22:40

@Sybren A. Stüvel For those searching, this is explained better in chapter 11 ;)

Blender Cloud

Blender Cloud is the creative hub for your projects, powered by Free and Open Source Software.

Facebook Logo Twitter Logo YouTube Logo
  • Films
  • Training
  • Blog
Services
  • Add-on
  • Blender Sync
  • Attract
  • Flamenco
  • Image Sharing
Libraries
  • HDRIs
  • Textures
  • Characters
  • Art Gallery
Cloud
  • Terms & Conditions
  • Privacy Policy
  • Contact
Blender.org
Loading...