Scene Monitor (new version 1.31)

Last chance for feature requests!  :stuck_out_tongue:



(Note: Objects in the scene flash as they are selected in the tree, as described and requested by Tobias)

Its done. That was alot of work! Please test it in your apps and let me know if it has any issues running in different game types, my biggest concerns are threading related. I've done a bunch of testing, but I don't want it to graduate from beta until you guys have put it through the ringer.  :wink:



A quick rundown of the features:



    [@]Simple to use, see usage example below.

    [@]Can register multiple nodes for watching renderpasses and gamestates.

    [@]Tree view lists entire scene graph including render states and controllers.

    [@]Support for jME Physics 2

    [@]Provides detailed information about entities and their properties.

    [@]Allows modification of all properties.

    [@]Objects in the scene flash when they are selected in the tool, so you know where it is.

    [@]You can add to or modify the information that is displayed.



See it in action... watch the video.




Usage
Using Scene Monitor is really easy. The Scene Monitor jar contains the basic application. The basic tool shows the structure of your scene starting from the node(s) you register. You can toggle object highlighting by clicking the lightbulb button in the upper right corner of the tool. With this turned on, any object or set of objects that are selected in the tool will be highlighted in the application. This is so you know which objects are which in your scene. Optionally, you can also include additional libraries which extend the functionality of Scene Monitor. Available now are two options: Text Descriptors and Properties. Text descriptors provide details about the selected item in a simple read-only format. Properties will organize the information into collapsable sections by inheritance, also allowing modification.


    [+]To begin, add the 'scenemonitor.jar' to your project or classpath.
    .
    [+]If you want text descriptions add the 'sm_textdescriptor_jme2.jar'. If you want editable properties add 'sm_properties_jme2.jar'.
    .
    [+]To tool can be displayed or hidden using the SceneMonitor.getMonitor().showViewer(); function. I would suggest adding a key binding to show or hide the tool during execution.

    [+]To add a node to the monitor list use SceneMonitor.getMonitor().registerNode(); where the string parameter is the display name in the list.

    [+]When that node is no longer accessible/used/rendered then unregister it with SceneMonitor.getMonitor().unregisterNode(); to remove it from the tool. A good place to do this would be in the cleanup method of a gamestate, or even override the setActive() so that the node is added and removed along with the gamestate.

    [+]To have the tool syncronized with your application, call the SceneMonitor.getMonitor().updateViewer();
    function during your update method whenever a node registered with this tool is being updated. This is optional, and if left out the tool will update whenever a selection is made.

    [+]To have the tool highlight selected scene objects, you must call SceneMonitor.getMonitor().renderViewer(); last, at the end of your render function whenever a node registered with this tool is being rendered. This is optional.


When you have Scene Monitor up and running

    [+]Toggling the selection highlight can be done by clicking the lightbulb in the top right corner.

    [+]Modifying properties for vectors, colors and quaternions will bring up a control like this: . You can manually enter values into the text fields, or you can click the slider button next to each field. Holding this down while moving the mouse will change the value as well. For more fine control, you may hold shift while using the slider.




import jmetest.effects.water.TestProjectedWater;

import com.acarter.scenemonitor.SceneMonitor;


/**
 * @author Carter
 *
 */
public class test extends TestProjectedWater {
   
   @Override
   protected void simpleInitGame() {

      super.simpleInitGame();
      
      SceneMonitor.getMonitor().registerNode(rootNode, "Root Node");
      SceneMonitor.getMonitor().showViewer(true);
   }

   @Override
   protected void simpleUpdate() {

      super.simpleUpdate();

      SceneMonitor.getMonitor().updateViewer(tpf);
   }

   @Override
   protected void simpleRender() {

      super.simpleRender();

      SceneMonitor.getMonitor().renderViewer(display.getRenderer());
   }
   
   @Override
   protected void cleanup() {
      
      super.cleanup();
      
      SceneMonitor.getMonitor().unregisterNode(rootNode);
   }

   public static void main(String[] args) {

      test app = new test();

      app.setConfigShowMode(ConfigShowMode.ShowIfNoConfig);
      app.start();
   }
}





I'm releasing this under the BSD license, for no other reason than that I don't know any better. Expect the source to be available very soon.  8)


Edited: Scene Monitor Google Code Project

The google code project is now up and running. Please visit and grab the latest sources or jars from the download tab. The wiki is growing with examples and instructions.



Also check out ncomp’s new Scene Worker extension to Scene Monitor at the project website!  :wink:



Scene Monitor Google Code Project

Sweet!



Can't try it since I use jME 1. When you make the 1.0 jars available I'll give it a spin in Mad Skills Motocross. I suspect this tool will be of great use. Well done!

Tobias said:

Sweet!

Can't try it since I use jME 1. When you make the 1.0 jars available I'll give it a spin in Mad Skills Motocross. I suspect this tool will be of great use. Well done!

I will try to do the jME 1 stuff tomorrow, it shouldn't take too long.

Congrats, this looks like a very useful tool!

I’ve finished the property descriptors for jME 1.0, and also recompiled everything to 1.5(5.0) compliance, as I unknowingly did it as 6.0 originally.



New links are in the above post.

I tried it out on Mad Skills Motocross and it works very well. It's perfect when positioning things, because I don't have to change the vectors in code and restart the game over and over again. Likewise for getting that perfect light angle.



Extremely useful, in other words. Well done, nymon.

Thanks for the great addon to jME!

Man i have do try this thing. ^^

It looks extremely usefull!

it is, already fixed a bug with the help of it :wink:

Tobias said:

I tried it out on Mad Skills Motocross and it works very well. It's perfect when positioning things, because I don't have to change the vectors in code and restart the game over and over again. Likewise for getting that perfect light angle.

Extremely useful, in other words. Well done, nymon.


I was trying to think of a useful way of tracking changes made by the tool. So you wouldn't have to write them down and what not. Maybe an contextual menu with a export properties to a text file option. Then you could figure out a bunch of settings at once, export, quit and put them all into the code.

What do you guys think?

Also, how is the usability? Any criticisms yet?

the only thing i was missing was the x/y/z extents of a bounding box.

would be nice if those could be displayed also.

I was trying to think of a useful way of tracking changes made by the tool.


Hmm, yes... that would be nice actually... Maybe a window with a text area, where all changes by the user from the original values are recorded:

Object1
localTranslation: [0, 0, 0] => [1.4, -2, 0]
localScale: [1, 1, 1] => [1, 2, 1]

Object2
....
....

Changing a field again would obviously update that line and not create a new one. Clicking a line would expand the tree to that field. Also some way to go back to the original value.

Usability-wise I like the tool. A tool-tip or status bar message saying "hold down Shift for better precision" would be good for new users, but other than that I find it very intuitive and easy to work with.

Hello nymon,



congratulations for this very nice tool.



Is it possible to add some functionalities like :

  • save position and size of the Scene monitor window
  • tell Scene monitor to select a node with something like : SceneMonitor.getMonitor().selectNode(selectedNode)



    Thanks for this great addon.
Tobias said:

Maybe a window with a text area, where all changes by the user from the original values are recorded.
....
Changing a field again would obviously update that line and not create a new one. Clicking a line would expand the tree to that field. Also some way to go back to the original value.

Good idea, I begin thinking on this!

Tobias said:
A tool-tip or status bar message saying "hold down Shift for better precision" would be good for new users...

Yes, good point. I missed that.

FredB said:

Is it possible to add some functionalities like :
- save position and size of the Scene monitor window
- tell Scene monitor to select a node with something like : SceneMonitor.getMonitor().selectNode(selectedNode)

Position and size is a great suggestion. Maybe I'll just have it create a .cfg file containing those values. SelectNode is genius. Why didn't I think of that?  :P

Hello Nymon,

your tool is incredible especially for beginners who can discover visualy jME object properties.



By the way, I may have discovered one bug (that you may be aware of): when I change say the red component of an emissive color using the controls you provide with the mouse, I get this exception:


Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "0,49"
   at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
   at java.lang.Float.parseFloat(Float.java:422)
   at com.acarter.scenemonitor.propertydescriptor.editor.A_EditorPanel.slideValue(A_EditorPanel.java:113)
   at com.acarter.scenemonitor.propertydescriptor.editor.ColorRGBAEditorPanel$3.mouseDragged(ColorRGBAEditorPanel.java:268)
   at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:303)
   at java.awt.Component.processMouseMotionEvent(Component.java:6086)
   at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3278)
   at java.awt.Component.processEvent(Component.java:5807)
   at java.awt.Container.processEvent(Container.java:2058)
   at java.awt.Component.dispatchEventImpl(Component.java:4410)
   at java.awt.Container.dispatchEventImpl(Container.java:2116)
   at java.awt.Component.dispatchEvent(Component.java:4240)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4003)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
   at java.awt.Container.dispatchEventImpl(Container.java:2102)
   at java.awt.Window.dispatchEventImpl(Window.java:2429)
   at java.awt.Component.dispatchEvent(Component.java:4240)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)



It may be an i18n issue because of the French JDK I use: "0,49" != "0.49"

Hopefully when modifying the property manually, it works :)

Thanks again for this great tool.

N.

Thanks Niggle, I hadn't seen that yet. It may be a few days before I can fix it for you, I just moved to Oakland and I'm trying to get settled in the city with a new job.

I found some time and adressed the issues/requests posted here. I may be able to upload the new version tomorrow when I get it built.



@Niggle: I think I've fixed your NumberFormatException, please test it for me when I post it.



@FredB: I've added saving of location and size of the dialog in addition to saving the last state of the Highlight button. I've also added a new function named 'selectSceneObject(Object)' which selects a given object (including renderstates) in the tree, and performs the rendered highlighting if it's visible geometry.



@Tobias: I think your request for tracking changes with revert and all that is a little too involved for version 1 at this stage of the game. I'm going to put it on the slate for version 2, because its a wonderful idea and I want to be sure to do it right. Oh, I also added the missing tooltip on the slider buttons.



I'll have it up soon…  :wink:

The new jars are up and I’ve updated the links in the previous post.