BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
22.8k stars 3.39k forks source link

Inspector v2 #5415

Closed deltakosh closed 5 years ago

deltakosh commented 5 years ago

Pre-release:

P1:

P2:

P3:

Nodragem commented 5 years ago

Some ideas:

deltakosh commented 5 years ago

You will like the new inspector. The scene view (ala Blender) is already in;) The gizmos will be there as well!

And more.

Let's keep this discussion going when I will be able to share the first alpha

PatrickRyanMS commented 5 years ago

I agree, @Nodragem, that you must have been sending your inspiration into our feature brainstorm because I think you will be very excited in the near future.

Vinc3r commented 5 years ago

Stop teasing us! :-p

deltakosh commented 5 years ago

Work in progress :) image

Vinc3r commented 5 years ago

looks nice!

deltakosh commented 5 years ago

It would be far better after the design phase by @PatrickRyanMS

Nodragem commented 5 years ago

I like the look of the interface already :) Can we see to which mesh(es) are the materials/textures attached?

deltakosh commented 5 years ago

We will :)

deltakosh commented 5 years ago

I plan to ship a first release next week (Would like to finish adding the GUI debugger first)

Nodragem commented 5 years ago

Speaking of the GUI. One big annoying thing when using a code-based game engine (i.e. without editor) is to position GUI elements and changing their color. The inspector will probably allow us to move and change the colour of the GUI elements, right? Would there be a way to save these changes somehow?

I guess we would get closer to a GUI editor then ^^ might as well make the inspector able to add/remove containers/controls/meshes then...

A similar idea can be developed for particle systems: it would be useful if we can save the tweaks we make to the particle system.

In fact, even if that may sound extreme, this new inspector may be the opportunity to make a new BabylonJS editor, that would be based on the same code base. You would divide the code base into modules that you would combine together to make the inspector, or the GUI editor, or the particle editor, or the full BabylonJS editor.

deltakosh commented 5 years ago

I do not want to create an editor (editor.babylonjs.com is already here and actively supported by Luaacro and the community) The inspector is designed to help debugging. You could still use it for more if you want of course but there will be a clear line between it and an editor

Nodragem commented 5 years ago

yep sure, I just had this thought that both projects could use the same code base but that was just a random idea. Good luck with the inspector :)

deltakosh commented 5 years ago

You should be able to test it this Monday or Tuesday

bghgary commented 5 years ago

2018-11-12_17-08-59

It would be nice if the gizmos axes had some shading and fade out like Unity.

Nodragem commented 5 years ago

From memory the gizmo in Babylonjs do not have the corner planes (see the image posted by @bghgary ) that allows the users to move the objects on the XY, YZ, XZ planes. That would be a great addition.

Same idea for scaling.

Concerning rotation, Unity's gizmo has a yellow circle that allows to rotate on the camera axis, which can be useful some times.

deltakosh commented 5 years ago

The plan here is not to replicate Unity:) but good ideas anyway

Nodragem commented 5 years ago

I think we should always check what others are doing before to do our own thing. I could have cited the new gizmos in Blender 2.8 instead.

Nodragem commented 5 years ago

I added some feedback here: http://www.html5gamedevs.com/topic/41408-feature-request-feedback-on-the-new-inspector/ I did not experience any bugs, but I was mainly missing collecting / displaying stats against time.

deltakosh commented 5 years ago

Good feeback! Thanks a lot

Nodragem commented 5 years ago

possible bug: My code is working fine without the inspector, and with the inspector 3.3.0, however, with inspector 4.0.0-alpha.9, I get the error:

Uncaught (in promise) TypeError: Cannot read property 'getUniqueId' of null
    at h.e (babylon.js:1)
    at new h (babylon.js:1)
    at new LetterFactory (Letter.ts:114)
    at Game.<anonymous> (test_letter_instancing.ts:115)
    at step (test_letter_instancing.ts:32)
    at Object.next (test_letter_instancing.ts:13)
    at fulfilled (test_letter_instancing.ts:4)

The line Letter.ts:114 being:

this.root = new BABYLON.TransformNode('letter_factory');
sebavan commented 5 years ago

Could you create a repro and open another issue for this as it would be easier to manage ? thx

ssaket commented 5 years ago

@deltakosh for p2 -

Better control for number input (something like up/down that we can manipulate with mouse)

will this work ? number

I have added type as number as a result, In chrome, I am changing values using mouse wheel. In Safari and Firefox this can be achieved by mouse click (wheel action is not supported currently).

deltakosh commented 5 years ago

Would love that!! Want to do it?

ssaket commented 5 years ago

yeah definitely 👍

Vinc3r commented 5 years ago

about color inputs, here some ideas listed by more to less convenience:


Also, be able to select/copy some text value could be great. Example: if I select a node on the explorer, I'm not able to quickly copy-paste its ID, Class, Unique ID, etc


Another point: we have readable properties (for example Disable lighting, which is great. But for those who doesn't know well BJS and its API, it could be difficult to know that Disable lighting = disableLighting (yep this example seems obvious Im' agree :-D). Maybe something like a little popup on mouseOver could be great (like it was in the last versions of inspector v1) ?

deltakosh commented 5 years ago
deltakosh commented 5 years ago

Ok pushing an update where text values can be copy and where colors can be controlled as independent components :)

Vinc3r commented 5 years ago

nice, GG :)

Vinc3r commented 5 years ago

another point (don't hate me please :-p):

we miss the roughness range input when in PBRMaterial class (it seems we have the PBRSpecularGlossinessMaterial levels properties, but not all from PBRMetallicRoughnessMaterial)

deltakosh commented 5 years ago

Will fix that :)

deltakosh commented 5 years ago

I will add more specific property grids for both PBR specific materials

ssaket commented 5 years ago

meanwhile, I did some sneak-peek on -

P3- Copy color values as RGB or hex into clipboard

I thought, adding document.execcommand('copy') to the onchange can fix this easily, but I was wrong. It seems it'll work only when the event is isTrusted/user triggered and onchange doesn't fall in this category, only click events. hmmm... know I know why other sites have a button next to code with a copy icon.

Being said that, one approach would be to provide a copy icon next to expand, and onclick "copy", similarly paste. But not sure if this is a good approach, Ideally I wanted do this inside onchange.

deltakosh commented 5 years ago

onchange is not good either because you do not want to overwrite user clipboard :)

deltakosh commented 5 years ago

@Vinc3r: new version coming in a few minutes

ssaket commented 5 years ago

Ahh... I see. Thanks DK !

Vinc3r commented 5 years ago

yeah, seems to work like a charm, great job! 👍

deltakosh commented 5 years ago

Copy for colors: image

deltakosh commented 5 years ago

Closing and moving remaining ideas to #5638