Create a Custom Blender Panel with less than 50 lines of Python code

  Рет қаралды 12,416

CG Python

CG Python

Күн бұрын

In this video tutorial, I'll guide you through creating a custom panel that will appear right in the sidebar of your 3D viewport.
I'll take you through all the necessary steps to create your very own panel, from start to finish. I'll show you how to turn your custom panel into a convenient add-on that you can use whenever you need it.
Final Code
github.com/CGArtPython/blende...
Using Python classes in Blender
• Using Python classes i...
Using Python Dictionaries in Blender
• Using Python Dictionar...
Space Types doc
docs.blender.org/api/current/...
Region Types doc
docs.blender.org/api/current/...
00:00 - Intro
00:53 - Go over the steps
01:24 - Create the panel class
03:53 - Register the panel class
05:11 - Finish defining the panel labels and UI layout
07:56 - Exercise
09:02 - Wrap the panel in an add-on
Assets used:
Register icons created by Pixel perfect - Flaticon www.flaticon.com/free-icons/r...
#blender #python #scripting #tutorial #addon

Пікірлер: 50
@onlyeyeno
@onlyeyeno Жыл бұрын
Thank You for this great tutorial, I really appreciate the "style" and "tempo" as well as the chosen appropriatley "byte size" examples ;) Best regards
@CGPython
@CGPython Жыл бұрын
Awesome, thank you!
@martafioravanti1004
@martafioravanti1004 8 ай бұрын
This guy is really saving me. Thanks a lot for the high-quality content and the clarity of your videos, bro
@CGPython
@CGPython 7 ай бұрын
Happy to hear that!
@sonu-jangir
@sonu-jangir 7 ай бұрын
Same...😊 ❤❤❤
@Cacapoulette
@Cacapoulette 2 ай бұрын
amazing explanation, thank you so much ! I like your way to show how you would find the information (documentation, blender logs), it's very important for us to learn the process as well.
@CGPython
@CGPython 2 ай бұрын
You're very welcome!
@TomasHradckyComposer
@TomasHradckyComposer Жыл бұрын
This is quite useful. Thank you.
@CGPython
@CGPython Жыл бұрын
You're welcome! 😊
@GenTechArt
@GenTechArt 9 ай бұрын
thanks for your tutorial ! very useful .
@CGPython
@CGPython 9 ай бұрын
Glad you liked it 😊
@vincentdecc3287
@vincentdecc3287 Ай бұрын
So good and clear tutorial...thank you !!!
@CGPython
@CGPython Ай бұрын
You're very welcome!
@arturertel
@arturertel Жыл бұрын
I enjoyed this tutorial, learned something new and hit the like button
@CGPython
@CGPython Жыл бұрын
Awesome, thank you Artur! ❤️
@TheStrokeForge
@TheStrokeForge 2 ай бұрын
Hey buddy. Amazing amazing work! It feels so good to have some blender python nerds (like myself) open KZfaq channel! Kudos, and blissfully well done on the tutorials!
@CGPython
@CGPython 2 ай бұрын
Awesome, thank you!
@npj5578
@npj5578 Жыл бұрын
Thanks for this. Would love a video going over how to run custom operators on buttons.
@CGPython
@CGPython Жыл бұрын
Thanks! That will be coming soon! 😊
@mind_of_a_darkhorse
@mind_of_a_darkhorse Жыл бұрын
Thanks for showing the basics of creating an add-on! I think you should do a course on Udemy or other such platforms as do many others judging by the comments! Keep up the great work!
@CGPython
@CGPython Жыл бұрын
Thanks for the idea! ❤️ Still working on searching for and providing good value to you and others. I don't want to make something for the sake of just making money.
@sonu-jangir
@sonu-jangir 7 ай бұрын
Fantastic... 🎉🎉🎉 ❤❤❤
@CGPython
@CGPython 7 ай бұрын
Thanks 🤗❤️
@akerka3
@akerka3 Жыл бұрын
Спасибо. Это ОЧЕНЬ доходчиво!
@cosmicoverlap
@cosmicoverlap Жыл бұрын
Thank you for this tutorial! I was wondering if you have a tutorial that covers texturing and displacement on a plane? I've been having a hard time trying to figure out how to import a texture while applying a displacement modifier to an object with the imported texture, all from an addon window. Thx.
@CGPython
@CGPython Жыл бұрын
I still need to get such a tutorial! But that is an interesting idea. Thank you Do you have any example add-ons that you were looking at? Have you posted your code anywhere?
@cosmicoverlap
@cosmicoverlap Жыл бұрын
@@CGPython I'm currently making one with the visual scripting add-on, Serpens, in Blender. I could share the code when I finish if you'd like.
@jamesashworth3133
@jamesashworth3133 3 күн бұрын
Are you able to lets say create your own custom panel from 3 other addons? Example If I have 3 lighting addons and would like to pick only certain features from them into a single panel?
@ngnash2856
@ngnash2856 4 ай бұрын
Thanks for tips @CGPython Is it possible to set panel's default width? I was trying bl_ui_units_x but it's not working -_-
@CGPython
@CGPython 3 ай бұрын
good question! I don't know. 🤔 I believe the Blender developers haven't provided the option to override or set that parameter. This could be because allowing add-on devs to scale the panel's width to their preference might lead to add-ons interfering and causing inconvenience to the user. It you find a way I would love to know
@Kotlinuxoid
@Kotlinuxoid 19 күн бұрын
Круто, спасибо, мужик! То что надо..
@Cadknowledge
@Cadknowledge Жыл бұрын
make more blender addon video please
@CGPython
@CGPython Жыл бұрын
Yes, I'm planning to do so! 😊
@cncpts66
@cncpts66 Жыл бұрын
Hi Victor was trying to find a way to contact you Had an idea about a tutorial It is pretty lengthy so didn't want to actually post it here, is there any other way I tried your Twitter but there was no way to send message?
@CGPython
@CGPython Жыл бұрын
Try Twitter again 🐦 I didn't notice that the DMs are disabled by default. Eventually, I'll make a github repo with idea/suggestions box.
@veolenco
@veolenco Жыл бұрын
is there a way to create multiple buttons with one operator but with different parameters? I just want to create only one operator class, but inside execute block I want to read the parameter. I mean only buttons, without props. For example, Button 1 calls a parameter that Creates one sphere, and Button 2 calls the same parameter which creates two spheres. And only parameters changes (1 or 2)
@CGPython
@CGPython Жыл бұрын
Hello, Thanks for your question! Here is an example of an operator with different params set on each button (see the mesh.add_subdiv_monkey buttons) gist.github.com/CGArtPython/f6f3c678d4ad0616f5a89891e2282f43 I took the script from this video tutorial kzfaq.info/get/bejne/ZsWBps6Wup6ngKM.html
@veolenco
@veolenco Жыл бұрын
@@CGPython Thank you very much! Your script is very useful. I waste all day yesterday. But you help me! You are better than Chat GPT! Thanks!
@CGPython
@CGPython Жыл бұрын
@@veolenco Happy to help! 😊
@paulblart5358
@paulblart5358 2 ай бұрын
Can you teach us how to wrap a c++ code in Blender and make a custom floating panel?
@CGPython
@CGPython 2 ай бұрын
Hey, Sorry, this channel is mainly focused on Python. I would recommend watching the Blender dev channel, for example, starting with this kzfaq.info/get/bejne/nbl5mrqQs53TY4k.html
@paulblart5358
@paulblart5358 2 ай бұрын
@@CGPython Thanks for the link. Maybe a generic wrapper for regular python?
@CGPython
@CGPython 2 ай бұрын
You can build the Blender as a python module that you can install in a generic Python install developer.blender.org/docs/handbook/building_blender/python_module/
@egretfx
@egretfx 7 ай бұрын
how do i add an image to the panel?
@CGPython
@CGPython 7 ай бұрын
I have a video explaining that here kzfaq.info/get/bejne/ZtCJpLec3LCRp5s.html
@Dedlus
@Dedlus 2 ай бұрын
Im at 4:49 and running the script just does nothing. Im incredibly confused.
@CGPython
@CGPython 2 ай бұрын
Are there any errors in the system console? Can you try to run the final code from here github.com/CGArtPython/blender_plus_python/blob/main/add-ons/simple_custom_panel/simple_custom_panel.py
@ewomer100
@ewomer100 7 ай бұрын
How do you turn a panel into a menu item?
@CGPython
@CGPython 6 ай бұрын
Sorry, I don't fully understand what you mean by this. Are you looking for how to add tabs in menus? Or do you want to understand how UI layouts work? Do you have an example of an add-on that does what you want to do?
Watch This Before you Get Started with Blender (7 Tips)
16:41
Blender Academy
Рет қаралды 56 М.
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30
Smart Sigma Kid #funny #sigma #comedy
00:19
CRAZY GREAPA
Рет қаралды 8 МЛН
2000000❤️⚽️#shorts #thankyou
00:20
あしざるFC
Рет қаралды 15 МЛН
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 13 МЛН
Getting Started with Scripting in Python
49:24
Blender
Рет қаралды 12 М.
Change Your Understanding of Topology In Six Minutes
6:58
DECODED
Рет қаралды 913 М.
Why I Use Maya Over OTHER 3D Software
16:58
Sir Wade Neistadt
Рет қаралды 99 М.
Should You give up Learning Blender Python?
6:25
CG Python
Рет қаралды 5 М.
Automate your job with Python
6:07
John Watson Rooney
Рет қаралды 358 М.
For Those Who Can't Learn Blender
10:14
InspirationTuts
Рет қаралды 541 М.
Using tkinter with classes
28:23
Atlas
Рет қаралды 51 М.
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30