Open UnidayStudio opened 6 years ago
Allow ranged values:
'name' : (0.0, (0.0, 1.0))
Concerning automatic reload, I was comparing with how blender script are managing it, but anyway components are based on python modules and not script so the actual file providing the module is not reachable.
In consideration, the way showing up is the reload of the components at any file open as it's impossible to check if the component have to be reloaded or not and that keeping a component with an invalid module is going to fail at game start.
@UnidayStudio : What do you think ?
Main proposal:
I'd like to propose two improvements to the Python Components UI that will help a lot from the user's perspective. The components, in the way it is now, serves its purposes (logically thinking), but I think that it can be better in the user point of view.
The first one is the possibility to minimize components, such as we can do with logic bricks. Imagine having thousands of components on the same object...
The second one is, when you add a new component, the program should create a list of all reachable components instead of asking for the name. It will mean to analyze every module and every classes inside to know which could be component, but it's a necessary effort. And you can do this verification only when the user click to add a new one. By the way, analyze just the scripts on the local path + inside blender is enough. And an option to write a custom component path (like we write right now) will fix the corner cases.
Other proposals to discuss:
And I'd like to put another suggestions on the table to discuss about them (if it's viable, better, worst, etc):
Why we can't just import bge.logic or bge.types? I tried this:
from bge import logic, types, events
and get an error... So it seems that the only way to use bge module using python components is to import everything together:import bge
why?What about the components to subclass KX_GameObject instead of just referencing them? And if we add two components, A and B, for example, A will subclassKX_GameObject and B will subclass A. I don't know if this is a good idea (or hard to implement). Unity and Unreal already does this way.
Can we add dividers on the component's interface? I mean... between two args... Like this:
args = {"height": 3, "DIVIDER":True, "weight": 150 }
and a line appear between "height" and "weight". Just to organize the components... I don't know if this is very complicated to do...PLEASE, can you guys add a color variable? Something like: 'args = {"Color Test":KX_COLOR_3, "Color Test 2": KX_COLOR_4}' (random name, just to illustrate). And a color selector will be exibed in the UI (returning a tuple or something like this). I'm creating a Button Component and I'm crying for having to add a Vector4 on each color selection.
Thanks! :smile: