SceneExplorer: Commands to add Primitives Shapes

From discussion : http://hub.jmonkeyengine.org/forum/topic/best-practice-which-tools-and-practice-for-level-design/page/2/#post-288355

I would like to add Action to create Primitives Shapes (Box, Sphere, Line, Cylinder) on Spatial in the SceneExplorer.

Why ?

  • To avoid the need to use 3d editor to create those meshes

Use Case :

  • To prototype a game, a scene quicker
  • To define zone, place holder that can be used as input data by AppState,…
  • ???

Questions :

  1. are you ok ?
  2. how to layout the commands ?
    2.1) add 4 Actions under “Add Spatial …”, sibling Node, … and named “Geometry : Box” ,…
    2.2) add 1 Submenu “Add Spatial …” > “Geometry” > “Box”
    2.3) add 1 Action “Add Spatial …” > “Geometry…” that open a wizard
  3. how to define Mesh arguments (for 2.1 and 2.2) ?
    3.1) use harcoded default value (which)
    3.2) use value define in user preferences editable via a panel (in its own window)
    3.3) via a dialogue box / wizard open each time
  4. WDYT ?

Options are sorted from easier to harder to implement, my favorite as user 2.2 + 3.2 quicker to use, my favorite as implemener 2.1 + 3.1 :wink:

Use case 3 : make effects. Pretty often you’re gonna make slash effects, explosions etc, and you can get away with a particle emitter. But you may want to make some more complex effects that involve animations of several quads with textures.
This will make a lot more sense with the upcoming Cinematic editor when you’ll be able to make spatial animations live.
On the top of my head in my last game, I made an aura effect with 2 rotating cylinders and a quad (ofc with textures) and the process would have been a lot easier if I could have directly add primitives to the scene composer.

so :

  1. yes
  2. 2.1 2.2 2.3 in the scene explorer, right click on a node/ add Spatial / primitive / w/e primitive (exactly like adding a particle emitter or a skybox is)
  3. wizard definitely. Since most primitive are built through their constructor there is no real way around it.
    3.1 not necessary IMO
    3.2 can’t do that without recreating the mesh every time the values are changed. No modification to core should be done to handle SDK needs (at least we should avoid it)
    3.3 yes
  4. well I guess I’m done thinking :wink:

Thanks for reply.

About 3.2, the settings is for the next creation, it’s not to manage already created. It’s main advantage over 3.3 is that you define size of the cube once, and then you can create several cubes without need of the intermediate wizard/dialog box (I’m not a fan of wizard).

I don’t understand your preference for 2.

oh ok didn’t get 3.2. Well, what if you want other values for the next cube?

For 2 I have no preference among your propositions so I made a new one :stuck_out_tongue: :
something like

you proposition is 2.2 (my favorite), I 'm very bad to explain.
3.2 is similar to

A preview of the current state, it will help to visualize the flow.

There are few bugs, like Box and Sphere above Primitives in second menu level.

[video]Add primitive geometries into jmonkeyengine sdk - preview - YouTube

2 Likes

a demo (no sound) of my PR

[video]jmonkey sdk addgeometry dev2 - YouTube

4 Likes

Nice, but boxes mesh are a bit weird, missing some triangles no?

No the box was created in Lines mode. Later in the video, you can see I change the mode for the second sphere (the first in Lines mode, the second in Triangles).
I define Lines as default mode. I can change the default. Every modifications in the panel are stored in user preferences, so there are keep between session.

Should I relocate (and relayout) the Configuration Window (NewGeometrySettings) from the output zone (bottom of netbeans, horizontal layout) to properties zone (left of netbeans, vertical layout) ?

Currently the window is cloded by default and open in output (bottom).

The thing is that the bottom area is meant for the current plugin or in the future the current selected scene edit tool. Having this additional window with different functionality in the same place would probably be confusing. For example, it would always get hidden when you select a different tool (in the future).

1 Like

I move the NewGeometrySettings in “commonpalette” zone + vertical layout :

Is it ok ?

2 Likes
@david.bernard.31 said: No the box was created in Lines mode. Later in the video, you can see I change the mode for the second sphere (the first in Lines mode, the second in Triangles). I define Lines as default mode. I can change the default. Every modifications in the panel are stored in user preferences, so there are keep between session.

Oh, right. Sorry.

One question, why not open a window to config the mesh we want to add rather than keep all the mesh config in one panel?

@david: I like it much better personally.

@normen:

You talk about wizard or the proposal to move panel on left side ?

@haze:

My current use case is to create lot of placeholders (box, spheres, quad) in the scene (level). For same placeholders (place all traps) it’s quicker (IMHO) to configure x [0-1] + (create, place) x n times, than to (create, configure (can be a simple click), place) x n times. Like @normen said (on github) I could copy/paste, but I, currently prefer to create several times (with random color). IMO, and original proposal configuration is optional, but as it seems confusing several people, it’s possible it’ll be moved to wizard, after some real experimentations and feedback with the current way. I would like to create some levels this week, so I’ll test it.

Thanks for comments.

Your latest change, the panel on the side.