Help finding UI script(s) for customization

I’ve been scrolling through a lot of different scripts in the blender-git, trying to find which one I can mess around with to change the ui. Specifically, the top bar where you can see the tool settings, the toolbar on the left side of the screen, the sidebar with the 3dcursor location, and the properties panel.

What script controls where all the things go? (Simply asking this is very telling of where I am at, beginner) I know it’s probably a handful of scripts. I saw a lot of stuff about how things are drawn, different column/row blocks, and on, and on, for thousands of lines in probably a dozen scripts.

I can’t figure out which script had the spot that was saying “Hey dummy, change this stuff and the toolbar will have different buttons, the top bar will show something else, and here’s where you can add/modify tabs in the properties panel”

I know people are busy and things are likely to change, a lot, but I’d like to start having some fun and understand things better. I’m obviously inexperienced but very willing to learn and not completely helpless. I did manage to make some custom cursors, and got selection working just like I want:

Thank you so much for your time and all that you’ve done so far. I wish I had switched to Blender before because after looking around a bit at the RC source, I think I would have been happy doing what I’m doing right now, even in pre-2.8

Hi.

I’m kind of a beginner too. This may not be the standard or best way but what I’ve been doing is:

  1. open the Text Editor(it will not automatically open)
  2. right click almost anything
  3. select “Edit Source” from the menu
  4. The exact line in the script for that item will be highlighted for you

And jsyk, the bl_* = '*' statements in the classes are used for assigning locations and the context in which panels appear and other things too.

2 Likes

Thanks for the very helpful tip, didn’t even know about these scripts. Was looking at all of the stuff you have to change before building blender. Who knows how much longer I would have been wasting my time in there.

Much nicer not having to rebuild every time I want to check out my changes.

Unfortunately I haven’t had any luck with what I have been able to get away with for making selection work how I need it. Can’t just throw some stuff in a different area and hope it still works anymore.

Going to have to actually do some learning and start with the fundamentals I am lacking.

Plan is to nuke everything in the topbar script except for the menu stuff. Try to make a button up there that works the same as the toolbar. Then just make a bunch more buttons.

UI wise you will find everything you need in

blender/release/scripts/startup/bl_ui

Python is used to setup the layout of the UI, but please note that the actually UI is implemented in C. But yeah if you want to move things around and create additional UI that’s the folder you looking for.

properties_* files should have the UI responsible for the properties window , while the rest of the windows’ UI can be found in their own space, for example Viewport window UI will be found in space_view3d.py and of course the toolbar in space_view3d_toolbar.py.

If you really care about the more low level stuff that show how Blender actual draws its UI , you will find most in the source code folder blender/source/blender/editors/interface and of course editors folders for each editor (internal window) you want to focus on.

2 Likes

Thanks, been playing around with python scripts for the past couple weeks off and on. Almost done doing what I want, but cannot find one last thing.

The sidebar transform area. I want to put it into a panel, and stop it from constantly collapsing and expanding itself when something is (de)selected. Problem is when you right click and say edit source, it tells you that it isn’t coming from a script and cannot be edited.

Looked around for it in the c files but not seeing where it is, have a feeling it wouldn’t even be coming from there. But since it doesn’t think it comes from a python script, that seems like the only place it would be.

You should find it in v3d_transform_butsR() in file view3d_buttons.c

But the Transform properties is actually already used in the Properties Editor within Object tab within the “Transform” panel - assuming that I understood you.

1 Like

Cool thanks, probably going to take some time to understand this script for me. The unique part about the sidebar version, from what I can tell, is the following:

  1. In edit mode, it lets you place verts in global and local space by inputting a number or dragging through

  2. In object mode, you can define the dimensions of a primitive in the same way

  3. In edit mode, you can assign a bevel weight to verts, haven’t played around with this yet but looks useful. Same for edge and face, also can define crease for these

@lcas

For the 3dView properties region, It looks like most, if not all, of the properties used in edit mode for the “Transform” panel are found in v3d_editvertex_buts()

1 Like

The “edit source” option when right clicking in a UI element seems to be gone in 2.8x. Perhaps it’s just been moved to some other place. Anyone knows if there’s an equivalent?

You have to enable Developer Extras first.

Go to Preferences -> Interface -> Display and enable Developer Extras
Now Edit Source will pop up by right clicking a button.

Source: https://docs.blender.org/manual/en/latest/editors/preferences/interface.html

1 Like