Blender Python Tutorial : Enumerator / Drop down Menu [learn python for beginners]

preview_player
Показать описание
In this Blender Python Tutorial, we will be taking a look at an Enumerator also known as a drop down menu.

Looking to learn Python for beginners? You are in the right place. Be sure to check out the Scripting Playlist!.

Using the Enumerator we can give the user a list of options. In this example we give the User the option to choose from three different basic options. You can take this further and create more complex presets. For example, the Text Tool addon has some presets that have several lines of code to achieve the effect.

I hope you find this Blender Python Tutorial helpful and as always thanks for watching!.
Рекомендации по теме
Комментарии
Автор

Not really related to the topic of the video but when you are deciding what to execute you might want to structure it using "else if" statements. All you need to do is add "el" before the second and third "if" statements (ie. elif self.preset_enum == 'OP2':). Doing this can improve performance as it will only test until it finds a match and then doesn't check any more options. In this case it will make very little difference performance wise as there are a fixed number of options. This also means you don't need to add an "else" as the last one but just for information purposes, adding "else:" as the last one gives you a place to put in code that will occur if nothing else matches.

JeffreyBlakeney
Автор

Dude! About a week ago I was trying for the life of me to figure out how to do an enumerator drop down. I was watching videos of yours from months ago and now you post this! Thanks so much! Glad I subscribed 😁

maglerdon
Автор

It's good your tutorials to learn the Blender with Python, whose tutorials are based on the use of meshes that exists in the Blender menu. Can you use another mesh for example, rectangle with two-dimensional and when can oriented with an angle, arc with angle ...

MultiSaded
Автор

Thanks for the great tutorial, can you show how to draw enum directly in the panel in your next tutorial I will always be thankful to you

noobplays-pro
Автор

Do you think you could make a 2nd part to this tutorial where you put the drop-down on a panel instead of a pop up window? I am trying to use a drop-down that's always visible on the panel to change between outfit options. For example, my character has 2 hats. I would like to be able to toggle between them using a drop-down on a Character panel. The options would be None, Hat 1, and Hat 2. I'm struggling to even figure out how to make a drop-down panel exist on a panel without executing an operator to bring it up.

maglerdon
Автор

Hey! Love the tutorials, man. They help me a lot with my development. I have a problem though. How do I change the values in the "item" parameter of the EnumProperty? I want to make a dropdown that lists all the objects in a scene which works until a new object is added, in which case, the script has to be run again to update the list... How do I do this?

purujitkulshreshtha
Автор

hi thanks for the video. Wonder if you could choose between small images (picture 1-2-3) instead of the items (op1-2-3)? It's possible? Could you make a video about this? Thank you very much

passionddesign
Автор

Possible to bind the enum property to something else rather than a static list? For example, what if I wanted a drop down list, that shows me all of the material slots of the active object? (Which updates depending on which object is selected)

roboko
Автор

Thank you. . .This is a good tutorial, but now I have more and more plug-in functions, I want to know how to write folder-style plug-ins (such as init). Now I can achieve it, but I am not very clear about some of its details. Do you know how to do it?

钟文星-jj
Автор

Is there a way to create a drop down menu in the little dialog box when creating a new mesh?

FunNooberCodingForBeginners
Автор

@4:49 you after select cube, you have to click "ok" to run the codes related to option cube, is it possible to get rid of the "ok" button? for example, after you select one option, the pop up panel disappear and the related codes have been executed.

EdJ
Автор

Hey there, I'm trying to create a dropdown list like this in the panel row inside a row.prop()

I want to use for my dropdown. And I want it to be in the main panel, not in a window manager.

Currently if I follow every step in your video, this won't populate in my panel. Can you help me understand how to do this correctly?

Beyond-Studios
Автор

Thanks for your tutorial!
Is it possible using this dialog to append in object context menu(right click menu)?I try to do this, there is no error, but the dialog window doesn't execute.

rayflywang
Автор

Thanks!
I would like to see how to make a dropdown button

cgcat
Автор

Hi Darkfall, how to make multiple reflections in different places? (in blender)

chukirango
Автор

It's possible that in I can make Full N panel pop up near to Cursor? in 3D view

dwithshubham
Автор

I just don't understand why you're making everything into a pop up window. Like every video I watch of yours trying to learn how to do something doesn't work for me because you make it a pop up winow.

knnoko
welcome to shbcf.ru