jayanam / bl_ui_widgets Goto Github PK
View Code? Open in Web Editor NEWUI Widgets for Blender 2.8
License: GNU General Public License v3.0
UI Widgets for Blender 2.8
License: GNU General Public License v3.0
Im not able to import the modules.
What cant i do?
This project is amazing, using custom UI unit and OpenGL implement UI rather than the inner classes, like Panel\Menu.... This makes the UI more flexiable to creation. But the UI unit is not enough to use, lacking of InputBox\CheckBox\Dropdown\Table, etc. Hope you can realize these UI unit.
need to show/hide widgets during operator run, or be able to re-define the layout dynamically.
When resizing Blender, the text inside the panel and buttons gets misaligned. The mouse hotspots also move along with it.
Would be great to leverage a resize window event to trigger a redraw?
Hi,
After opening blender client, I install the widget and invoke it with Ctrl + Shift + k. Everything works fine, the widget displays and works. Then with the widget displayed I click New -> General -> Don't save. In the Console I get the following stack trace:
Read prefs: C:\Users\Grzegorz\AppData\Roaming\Blender Foundation\Blender\2.90\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender 2.90\2.90\python
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 82, in draw_callback_px
for widget in self.widgets:
File "C:\Program Files\Blender Foundation\Blender 2.90\2.90\scripts\modules\bpy_types.py", line 717, in getattribute
properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type DP_OT_draw_operator has been removed
Then, in the new scene, when I press Ctrl + Shift + k, the widget displays, but in the consol window I get a continuous stream of errors exactly like above. Any idea how to fix this?
It would be great to re-define layout during execution, although it's possible that the new .visible property will be sufficient if it will work for e.g. a panel with children together.
Simply hitting ctrl+space to maximize area throws error and causes the sampel widget operator to hang:
I think the library should store the link to areas differently (like indices or something), and should actively find a new area if it looses the original one, or end itself.
location: :-1
Error: Python: Traceback (most recent call last):
File "C:\Users\vilem\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 60, in modal
def modal(self, context, event):
File "C:\Users\vilem\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bl_ui_widgets-master\bl_ui_draw_op.py", line 52, in handle_widget_events
File "C:\Users\vilem\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bl_ui_widgets-master\bl_ui_widget.py", line 93, in handle_event
inrect = self.is_in_rect(x, y)
File "C:\Users\vilem\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bl_ui_widgets-master\bl_ui_widget.py", line 119, in is_in_rect
area_height = self.get_area_height()
File "C:\Users\vilem\AppData\Roaming\Blender Foundation\Blender\2.92\scripts\addons\bl_ui_widgets-master\bl_ui_widget.py", line 116, in get_area_height
return self.context.area.height
AttributeError: 'NoneType' object has no attribute 'height'
Hi Jayanam. I found your widgets so brilliant that I ended up making a fork of it with some additional features for my personal use. Now I've put together a full addon using the widgets and it works as expected. The few changes I did over your original code was to make the widgets mimic Blender's components and also to have them all follow the selected themes (in regards to colors, resolution scale etc). Thank you very much for creating this awesome UI and sharing it with the community. That is much appreciated. Everyone is welcome to take a look and try my fork at: githup.com/mmmrqs/bl_ui_widgets.
Below is a small image of how the sample panel appears on the viewport display.
All the best,
Marcelo
Hi Jayanam,
I've been using a modified version of bl_ui_widgets for years, and while looking to merge you recent edits I realized it was unmaintained and found this maintained fork: https://github.com/mmmrqs/bl_ui_widgets
Maybe this repo could be sunset in favor of that one or linked to it?
Thanks
Hi, great tool. Instead of invoking the widget with a key combination I would like for it to happen whenever addon is loaded and I reload a scene. I tried to run it via Operator Search in the gui and by executing bpy.ops.object.dp_ot_draw_operator('EXEC_DEFAULT') in a persistent handler that I add in the register method - no success there. Any ideas? Thanks
Generally, all mouse interactions would be great to have.
Disecting what I tried to commit in the pull requests to a few needed functions.
-Need to call these to draw a tooltip or call own functions on entering elements.
-Also would be great to be able to parse keyboard shortcuts - on_keystroke or similar in modal function.
Further needed functions are actually for all mouse interactions - mouse wheel, right-click .
The images drawn still need glTouch() or some other solution to not turn black. An issue was posted for it but was closed.
bl_ui_button.py - from line 88 should be:
vertices = (
(self.x_screen + off_x, y_screen_flip - off_y),
(self.x_screen + off_x, y_screen_flip - sy - off_y),
(self.x_screen + off_x + sx, y_screen_flip - sy - off_y),
(self.x_screen + off_x + sx, y_screen_flip - off_y))
Currently there's a - off_x on the last coorinate Y which draws the corner offset on non-square offset values.
It would be more convenient and logical if you set .visible for a panel if it would hide all children widgets
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.