fireclawthefox / directguidesigner Goto Github PK
View Code? Open in Web Editor NEWA Visual Editor for Panda3Ds Direct GUI
License: BSD 2-Clause "Simplified" License
A Visual Editor for Panda3Ds Direct GUI
License: BSD 2-Clause "Simplified" License
variable prcFileName needs to be set for writing. It actually should be given already since it's also the place where settings will get loaded from. Maybe just missing a self. or passing it to the function.
File ".../DirectGuiDesigner/DirectGuiDesigner.py", line 1328, in hideSettings
with open(prcFileName, "w") as prcFile:
NameError: name 'prcFileName' is not defined
If self.selectedElement
is None
(no element is selected) while pasting options the application crashes. Adding a check in the method pasteOptions
in DirectGuiDesigner fixes the issue. Something like this:
def pasteOptions(self):
if self.copyOptionsElementInfo is None: return
if self.selectedElement is None: # if no object is selected
base.messenger.send("showInfo", ["Please select an object to paste to"])
return
self.__copyOptions(self.copyOptionsElementInfo, self.selectedElement)
Do you prefer a new pull request for every issue? Or can I add several bugfixes to the same pull request?
When creating a button and adding a command, the command will be exported including the quotation marks for strings (').
These should not be used for this kind of parameter.
Currently stated options like text, image, etc for states like hover, click, disabled, and so on have to be set for each state individually and can not be simply "copied" over to all other states or simply be set for every state at once.
Option 1: Add stateless property entries like text for entering text for text1, text2, etc.
Option 2: Add button next to entries to copy to other states
Option 3: Selection on top to only show a specific state or "all" states
I was thinking that it would be useful to be able to use the widgets from your DirectGuiExtention in the designer. But, before I work on that, I would first like to make some changes to how custom widgets get loaded in the editor:
Most, but not all, options in a .widget file use CamelCase. For consistency I would like to rename:
visiblename
to visibleName
.optionmenu
to optionMenu
.displayName
to visibleName
for consistencyclassfileName
to classFileName
Other changes:
To match naming between editType and internalType, I would like to rename the option int
to integer
in internalType.
It could be useful to have an option to specify to what node new items should be attached to. This would be useful for classes similar to DirectScrolledFrame that has a canvas to attach new nodes to. Or would you prefer that custom widgets just define an addItemFunction instead?
For example the DirectGridSizer requires some extra arguments to be passed to its addItemFunction, which is not supported at the moment. For this we could add an option with some extra args for the addItemFunction in the .widget file.
I do however fell like it might be better to keep the complexity of the custom widget loader down and simply add workarounds in DirectGuiExtention to deal with 6 and 7.
What are your thoughts on the matter?
When adding an entry to a list or tuple property the property panel is refreshed and the new entry is removed. By updating the sections of the panel, instead of refreshing the panel every time an entry is added, the issue is resolved.
In other words, do this:
if updateMainBox:
entriesBox.refresh()
for section, boxFrame in self.boxFrames.items():
boxFrame.refresh()
self.updateSection(section)
section.toggleCollapsed()
section.toggleCollapsed()
and remove the line:
self.resizeFrame()
Hi again, I have found a few more bugs.
When entering an invalid path to a path property (for example image or geom) the program crashes. This is because of the line updateElement[updateAttribute] = None
, where updateElement
and updateAttribute
are undefined (this is in the method __createPathProperty
). Replacing it with elementInfo.element[definition.internalName] = None
fixes that issue.
I also noticed that if you first enter a valid path and then enter an invalid one the image is removed from the first state but still there for all other states. But if you first set the property to something else (for example None
) before restoring the old value the old image is set for all states.
Something like this (added in the exception clause of the setValue
method of the propertyHelper
):
if definition.nullable:
elementInfo.element[propName] = None
elementInfo.element[propName] = oldValue
This feels a bit hacky, but I haven't found a better solution. This also requires the image and geom properties to be marked as nullable, which seems reasonable to me.
File extension could be .ui
ERROR: Could not find a version that satisfies the requirement panda3d (from versions: none)
ERROR: No matching distribution found for panda3d
Traceback (most recent call last):
File "D:\Github\DirectGuiDesigner\setup.py", line 10, in <module>
setup(
File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\site-packages\direct\dist\commands.py", line 436, in run
self.build_runtimes(platform, True)
File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\site-packages\direct\dist\commands.py", line 596, in build_runtimes
wheelpaths = self.download_wheels(platform)
File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\site-packages\direct\dist\commands.py", line 499, in download_wheels
subprocess.check_call([sys.executable, '-m', 'pip'] + pip_args)
File "C:\Users\Michael\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\Users\\Michael\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'download', '-d', 'D:\\Github\\DirectGuiDesigner\\build\\__whl_cache__\\manylinux1_x86_64_cp310', '-r', 'D:\\Github\\DirectGuiDesigner\\requirements.txt', '--only-binary', ':all:', '--abi', 'cp310', '--platform', 'manylinux1_x86_64', '--extra-index-url', 'https://archive.panda3d.org/simple/opt', '--extra-index-url', 'https://archive.panda3d.org/thirdparty']' returned non-zero exit status 1.
Currently the designer does not support having multiple widget types with the same name. This becomes an issue if someone wants to make their own variants of default DirectGui widgets. Then only the custom widget can be selected in the ToolBox panel. If you try and create the default variant, the custom one is created instead.
Thanks for this program. It has been a great help in allowing me to design my UI.
Pip won't install Panda3d 1.10.8 any more, so I installed 1.10.11. This is probably what causes my problem. If I insert any object with a thumb, I get an error:
File "~/panda3d/DirectGuiDesigner/DirectGuiDesigner/panels/PropertiesPanel.py", line 969, in __createBaseNInput
if updateElement[parts[0]] is not None:
File "~/panda3d/DirectGuiDesigner/dgd/lib/python3.10/site-packages/direct/gui/DirectGuiBase.py", line 484, in cget
raise KeyError('Unknown option "' + option + \
KeyError: 'Unknown option "thumb" for DirectSlider'
I believe the problem is caused by option thumb_image_size
, being split.
To reproduce:
Incidentally the Startup section readme also needs to be updated to change the name of the main program from DirectGuiDesigner.py to main.py
Add a tab bar and the ability to load multiple project files
The sound files for button click and rollover can not be passed as strings but have to be loaded as audio files (e.g. loader.load_sfx("..."))
Hi,
When editor scale is set to Pixel, the grid is drawn on top of the Designer Settings Dialog when the latter is displayed. This does not happen with the Help Dialog however.
A problem that occurs with both dialogs is that when the editor window is quite small, there does not seem to be a way to close these dialogs, as their OK/Cancel buttons are not accessible then.
If I may, I'd like to suggest assigning hotkeys to them for this purpose. For example, F1 might toggle the Help Dialog instead of just showing it, while Escape would be a good choice for closing both dialogs, I think.
It might also be a good idea to block the entire GUI whenever a dialog is shown, just to prevent bugs due to unforeseen user interaction; perhaps overlaying a window-filling MouseWatcherRegion with suppress flags on top of the GUI but below the dialog could work?
On a side note, I'm glad to see that the editor no longer starts in high resolution (1920 by 1080 pixels). This seemed to force the application to start in fullscreen mode and behaved very strangely on my laptop, to which I have a monitor attached whose native resolution is 1920 x 1080, while that of the laptop's built-in screen is a bit lower. What happened there was that the monitor blacked out for a split-second, then displayed the window in a slightly blurry, seemingly lower-res mode (although a screengrab I made was indeed 1920 x 1080), but the editor window was still decorated. There were some other applications open at that time, and when everything went back to normal after closing the editor, the windows of those applications had been downsized (presumably to fit that apparent lower resolution).
Hello, I've started using your GUI editor and it's amazing, well done!
Just a potential bug that I may have discovered, when creating an Ok/Cancel dialog and exporting it into Python code, I get this error:
KeyError: 'Unknown options "Button_borderWidth, Button_frameSize, Button_hpr, Button_pad, Button_pos, Button_text" for OkCancelDialog'
.
Looking at the code, I have noticed that there are parameters for both Button
and Button0
, I didn't get errors for Button0
and I seem to have fixed this by replacing all Button
s with Button1
. Here is the full working code for my modified code:
class GUI:
def __init__(self, rootParent=None):
self.pg125 = OkCancelDialog(
frameSize=(-0.3324999973643571, 0.3324999973643571, -0.34249999769032, 0.19224999830126763),
hpr=LVecBase3f(0, 0, 0),
pos=LPoint3f(0, 0.1, 0.025),
state='normal',
text='Ok/Cancel Dialog',
Button1_borderWidth=(0.01, 0.01),
Button1_frameSize=(-0.09699999749660491, 0.10150000661611557, -0.016750000640749933, 0.05349999874830246),
Button1_hpr=LVecBase3f(0, 0, 0),
Button1_pad=(0.01, 0.01),
Button1_pos=LPoint3f(-0.109175, 0, -0.21575),
Button1_text='Cancel',
Button0_text_align=TextNode.A_center,
Button0_text_scale=(0.06, 0.06),
Button0_text_pos=(0, 0),
Button0_text_fg=LVecBase4f(0, 0, 0, 1),
Button0_text_bg=LVecBase4f(0, 0, 0, 0),
Button0_text='Ok',
text_align=TextNode.A_left,
text_scale=(0.06, 0.06),
text_pos=(-0.23549999739043415, -0.012749999761581421),
text_fg=LVecBase4f(0, 0, 0, 1),
text_bg=LVecBase4f(0, 0, 0, 0),
parent=rootParent,
)
self.pg125.setTransparency(0)
def show(self):
self.pg125.show()
def hide(self):
self.pg125.hide()
def destroy(self):
self.pg125.destroy()
gui = GUI()
gui.show()
Cutting and pasting elements does not currently support undoing. We should probably add a call to the kill ring in the method pasteCutElement
.
If you copy an element (1) onto another element (2) and then tries to undo a couple of times the application crashes. Specifically undoing the creation of element (2) seems to be the issue.
Here is the log file for the that issue:
DirectGuiDesigner.log
Editing of options, like text_align, text_fg and so on of a button or other elements doesn't work anymore.
Need to change the way those are accessed for setting and maybe getting
Implement possibility for selecting multiple widgets at once
Things to consider:
Check node editor for how multiselect is handled there (selection, boxselect, move, etc)
Hi,
When I press the toolbutton to switch editor scale to Pixel, the change is pretty much instantaneous. But when I switch back to Aspect, this takes up an entire second on my laptop and about half a second on my desktop PC.
That's with a completely empty layout, so I find this lag a bit surprising.
To clarify, the entire application seems to freeze during that time; the button tooltip doesn't disappear and the interface is unresponsive.
Do you have any idea what might be causing this?
Tested on Windows 10
Thank you for making this designer, it is very helpfull when designing GUI:s.
When setting an image for a gui object the program crashes when trying to load the image. I am using Windows 10. The crash occurs on both the latest release and the master branch version.
Console output (using master version):
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
:express(warning): Filename uses Windows-style path: C:\Users\augus\PycharmProjects\DirectGuiDesigner\DirectGuiDesigner\icons\ArrowDownSmall.png
:express(warning): expected Unix-style path: /c/Users/augus/PycharmProjects/DirectGuiDesigner/DirectGuiDesigner/icons/ArrowDownSmall.png
:gobj(error): Texture::read() - couldn't read: C:\Users\augus\PycharmProjects\DirectGuiDesigner\DirectGuiDesigner\icons\ArrowDownSmall.png
:express(warning): Filename uses Windows-style path: C:\Users\augus\PycharmProjects\DirectGuiDesigner\DirectGuiDesigner\icons\ArrowDownSmall.png
:express(warning): expected Unix-style path: /c/Users/augus/PycharmProjects/DirectGuiDesigner/DirectGuiDesigner/icons/ArrowDownSmall.png
:gobj(error): Unable to find texture "C:\Users\augus\PycharmProjects\DirectGuiDesigner\DirectGuiDesigner\icons\ArrowDownSmall.png" on model-path /c/Users/augus/PycharmProjects/DirectGuiDesigner/DirectGuiDesigner/;.;/c/Users/augus/PycharmProjects/DirectGuiDesigner;/c/Users/augus/PycharmProjects/DirectGuiDesigner/venv/Lib/site-packages/panda3d/etc/..;/c/Users/augus/PycharmProjects/DirectGuiDesigner/venv/Lib/site-packages/panda3d/etc/../models
:gobj(error): Texture::read() - couldn't read: /c/Users/augus/PycharmProjects/DirectGuiDesigner/DirectGuiDesigner
:gobj(error): Texture "/c/Users/augus/PycharmProjects/DirectGuiDesigner/DirectGuiDesigner" exists but cannot be read.
:gobj(error): Texture extension "" is unknown. Supported texture types:
Texture Object .txo
DirectDraw Surface .dds
Khronos Texture .ktx
SGI RGB .rgb, .rgba, .sgi
Targa .tga
Raw binary RGB .img
SoftImage .pic, .soft
Windows BMP .bmp
NetPBM-style PBM/PGM/PPM/PNM .pbm, .pgm, .ppm, .pnm
Portable Float Map .pfm
JPEG .jpg, .jpeg
PNG .png
TIFF .tiff, .tif
OpenEXR .exr
stb_image .psd, .hdr, .gif
MovieTexture .asf
MovieTexture .avi
MovieTexture .flv
MovieTexture .m2v
MovieTexture .mkv
MovieTexture .mov
MovieTexture .mp4
MovieTexture .mpeg
MovieTexture .mpg
MovieTexture .nut
MovieTexture .ogm
MovieTexture .ogv
MovieTexture .webm
MovieTexture .wmv
:task(error): Exception occurred in PythonTask eventManager
Try to save file after unhandled exception. Please restart the app to automatically load the exception save file!
Try to save file after unhandled exception. Please restart the app to automatically load the exception save file!
Process finished with exit code 1
And the log file (also with master version):
DirectGuiDesigner.log
This is a very minor issue, but the help dialog claims that the keyboard-event control-delete
can be used to delete objects. Destroying objects is actually bound to just delete
instead. What would you consider to be the expected behaviour?
To err is human, and I have developed a compulsive reflex to hit ctrl-z when I inevitably ruin progress.
The performance of the properties panel is affecting the whole application, dragging a widget around, changing options etc, makes the full panel reload
If the user wants to have different images for different states (e.g. button click, hover, normal and disabled), he needs to set them for the OnscreenImage of the desired state. But, setting it in one OnscreenImage also sets the same image value of all other OnscreenImages of the same button. The editor view still shows the correct images though but exporting them will result in only one image being used.
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.