FX Builder : cloning & save/load capsule support

Everything you need to use it is here:

UPDATE: Pushed out an update with a few changes. Sourceforge cooperated. yay.

https://sourceforge.net/projects/tonegodemitter/files/

  1. Download both tonegod.gui.jar and tonegod.emitter.jar
  2. Download and unzip the EmitterVS.rar file into your jMonkeyProjects folder
  3. Open the EmitterBuilder project in the SDK and the IDE should prompt you to resolve two missing dependencies. (See the post below from @sgold if you have any issues with this step)
  4. Point these to the downloaded jars, run the project and you’re off

NOTES:
To access the options menu, press the ESC key, press it again to hide the options menu
There is a test project available in the saved projects folder. To acces this:
** Open the Options menu (ESC Key)
** Click Load Project
** Select TestProject.xml and click the Load button
** Open the options menu again and click Script Editor
** Move the window up and out of your way, then click Run Scripts

After that, create a new project and see what you think.

You can add any meshes, textures, etc you want to work with into the assets directories, just remember to restart the Builder so you have access to them :wink: I’ll likely change the way this works to build selectable lists of assets, I just didn’t have time to do this yet.

The Emitter Overview Pane:
S = Emitter & Shape Properties Pane.
P = Particle & ParticleShape Properties Pane
I = Influencers Overview Pane
X = Remove Emitter

The rest of the app is more verbose than this, and should be easier to understand.

DISCLAIMER:
This is still a work in progress, though I need to start getting real feedback on how it would work for you, what you would like to see, etc, etc. There are a few key features that are not finished yet… these are:

** Code Output is incomplete - though it is far enough along to give you a really good idea of how to use the particle system via code.
** Particles Mesh Shapes only support Quad, JME Primitives and Impostor through the builder atm. Animated Mesh As Template will be added to the builder soon as will Point-based.
** You can not configure the test scene… it is what it is for now, but gives you something to test both AlphaAdditive blending & Particle Physics
** The scripting engine only allows for 2 types of scripts for now… eventually, I’ll extend it to allow for influencer manipulation, etc, etc
** Though, the options menu shows you can configure the test scene, this is not implemented yet.

FINAL NOTES:
There are likely many bugs in the builder I have not seen yet… so… Feedback! I’m interested in getting thoughts, ideas, critiques, etc after you have had a chance to play around with it.

7 Likes

I’ve been looking forward to this!

I downloaded per your instructions.

My first comment is that resolving the missing dependencies was more difficult than it needed to be because the EmitterBuilder project wants to resolve tonegod.gui and tonegod.emitter as projects, not JAR files.

In order to resolve the errors, I had to go into the IDE (project -> Properties -> Libraries), delete the red project dependencies and add the two JAR files.

1 Like
@sgold said: I've been looking forward to this!

I downloaded per your instructions.

My first comment is that resolving the missing dependencies was more difficult than it needed to be because the EmitterBuilder project wants to resolve tonegod.gui and tonegod.emitter as projects, not JAR files.

In order to resolve the errors, I had to go into the SDK (project -> Properties -> Libraries), delete the red project dependencies and add the two JAR files.

Thanks for posting this! I’ll update the download soon, but others will know what to do. Did everything run ok after this?

1 Like
@t0neg0d said: Did everything run ok after this?

The EmitterBuilder seems to run fine on my desktop. I’m playing with it now. My current difficulties are in figuring out how to use it.

A tutorial would be nice. For instance, if I hadn’t read your original post, I wouldn’t have known to type Esc to get the main menu.

The learning curve might be easier if all buttons were labelled with English phrases instead of single-letter mnemonics like S, P, I, and X.

“Config test scene” doesn’t appear to do anything yet.

1 Like

New stuff to try out!

I am going to add the raw emitter jar and mess with it.

Any accessible JAVADOC associated with the jars?

You should try and integrate it into the ide.

1 Like

@squizzle
I’ll be releasing the emitter source and JavaDocs when this is complete. The builder has really put it through it paces and helped me track down any issues. It shouldn’t be long before this project is sum’d up and I’m comfortable saying the emitter is stable.

@sgold The little emitter overview window is cryptic and I should have mentioned what it stood for. The rest of the app should be in plain Eglish :wink: --heh, I misspelled English >.< That should make people feel REALLY comfortable :wink:

S = Emitter & Shape Properties Pane
P = Particles & Particle Shape Properties Pane
I = Influencers overview Pane
X = Remove Emitter

EDIT: And, aye… config test scene is not implemented yet. It will (at a minimum) allow you to adjust where the scene is placed. I’m hoping to allow you to add you own models to test against at some point… though, that may be a little overkill for the purpose of the test geometry. Actually, being able to enabled some different JME Filters to more closely model your game environment might be nice.

2 Likes

For the builder: Slight modification I would suggest is having a menu at the top with easy access to the panes and file operations (new, save, open, recent), settings etc.

@squizzle said: For the builder: Slight modification I would suggest is having a menu at the top with easy access to the panes and file operations (new, save, open, recent), settings etc.

I originally was going to use a standard menu bar across the top of the screen, and will likely update this to do just that, though, I need to refactor EmitterBuilder.java as it is a mess atm, due to the “coding by the seat of your pants” approach I took building this (I had no clear app design laid out before starting it)

EDIT: The approach I settled on for The shapes & influencer dialogs is clean, easy to manage and makes it VERY easy to add new features. Once I’m done tearing that section apart and splitting out UI components, I’ll rework the menu idea.

I’m going to push out a new version of this tonight with an update for file selection. I put together a file browser with preview pane control to make it easier when selecting emitter shapes, particles shapes and updating particle material textures.

Feel free to grab the FileBrowser control for your own projects. When setting it up, you can:

  • Limit the root directory
  • Define extension lists
  • enable/disable the preview window

Do note, that I am currently establishing a path to files in a very specific way… you’ll have to update this yourself if you interested in the control.

Anyways, I’ll post a quick note once the update is out there.

1 Like

Hi @t0neg0d,

i get an error when trying it.

java.lang.NoSuchMethodError: com.jme3.math.Vector3f.interpolate(Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;F)Lcom/jme3/math/Vector3f;
at emitter.influencers.SizeInfluencer.update(SizeInfluencer.java:42)
at emitter.particle.ParticleData.update(ParticleData.java:196)
at emitter.Emitter.update(Emitter.java:808)
at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:570)
at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:688)
at com.jme3.scene.Node.updateLogicalState(Node.java:145)…

Vector3f has an interpolateLocal method but no interpolate…i believe it’s a recent change (i use nightly build, so maybe it’s not released yet). I can’t change it cause i only have the .jar and i think you don’t want to do it now for those don’t use nightly builds. So…just to say you will have to do it…a day.

Maybe i’ll go back to the off release to test it…if it doesn’t break any of my projects ;).

@haze said: Hi @t0neg0d,

i get an error when trying it.

java.lang.NoSuchMethodError: com.jme3.math.Vector3f.interpolate(Lcom/jme3/math/Vector3f;Lcom/jme3/math/Vector3f;F)Lcom/jme3/math/Vector3f;
at emitter.influencers.SizeInfluencer.update(SizeInfluencer.java:42)
at emitter.particle.ParticleData.update(ParticleData.java:196)
at emitter.Emitter.update(Emitter.java:808)
at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:570)
at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:688)
at com.jme3.scene.Node.updateLogicalState(Node.java:145)…

Vector3f has an interpolateLocal method but no interpolate…i believe it’s a recent change (i use nightly build, so maybe it’s not released yet). I can’t change it cause i only have the .jar and i think you don’t want to do it now for those don’t use nightly builds. So…just to say you will have to do it…a day.

Maybe i’ll go back to the off release to test it…if it doesn’t break any of my projects ;).

Let’s try this again :wink:

The API Fairy has magically made the interpolate method disappear in nightly. I wish I had time to support anything other than the current stable release. But with how changes are implemented, I couldn’t even pretend to think I could keep up with them all.

So sorry… I’ll release the emitter code soon and you can modify it to support the branch you are using.

1 Like

No problem, it’s my mistake ^^.

And thanks for your efforts.

1 Like
@haze said: No problem, it's my mistake ^^.

And thanks for your efforts.

I really will be releasing the code soon. I’m using this as a tool for fleshing out issues prior to releasing it.

Ok… I was finally able to upload the update for this project. The file browser turned out pretty nice. Used the OSRViewPort for the select mesh dialog so you can preview the mesh, rotated, zoom etc. The image preview was actually more the reason this was added, it became irritating very fast trying to remember how many sprite rows/cols were associated with what image.

Here is what it looks like:

[video]http://youtu.be/iPb80m2XW1w[/video]

2 Likes

So,

If any one is interest, I’m at the point where this is what is left to do.

Cloning is complete… you can cloneForSpatil, or just clone the emitter and all of it’s influencers. This is implemented and I’ll be updating the downloadable jar soonish with the update.

As for exporting to j3o… I’ve been giving a lot of thought to @nehon 's suggestion of a control that wraps the project for the builder and think that it’s a great idea. Currently, the individual Emitter is savable (will be once I push out the update anyways), but, this is the plan for the FX builder:

  1. A control is created to encompass the entire project you build.
  2. The control contains a SafeArrayList of all Emitters
  3. The control will likely have some method (execute for instance) that will run the sequence of scripts you add to the project.

So, in the end, you will export the project to j3o, move the j3o to your project, load it, potentially clone it per instance and call execute to run the sequence of events to reproduce the effect you build.

Anyways, I should be done with it in the next day or two, then I’ll open the source for the emitter and you all can do what you like with it

NOTE: For those using nightly, you will need to update any use of Vector3f.interpolate to Vector3f.interpolateLocal if you wish to use it with nightly. (More specifically, both the emitter and the gui library use this method… The sources are/will be available for both)

6 Likes

Pretty cool :slight_smile:

1 Like

Actually,

Concerning saving to j3o format, I have an issue that I could use some brain-power behind.

Using an animated mesh as an emitter shape… why is this an issue? Well, let me explain the depths of my woes:

This feature is more useful than you might initially think and here is why:

  • You have a character in your game
  • You’re character is hold two super cool, awesome rare weapons, that require particle emitters to show exactly how cool and awesome they are
  • You want one to show animated electrical discharges that climb the length of the blade
  • it will require you to set the emitter shape to the instance of the loaded mesh… why? Because when you animate the character, you probably don’t want to have to animate a second copy of that mesh in the emitter. You’ll want to set the emitter shape to actual mesh loaded for the character and just manage that model’s animations.

So what is the problem?

If the project is saved as a j3o and loaded this way, the mesh associated with the emitter will be loaded as well… though the actual mesh being loaded is completely useless and doing nothing more than eating up resources.

Yeah, you can retrieve the emitters from the control and change the shape to the new instance, but you still have the emitter mesh being loaded for no reason.

Anyone have any thoughts on how to bypass this issue?

Don’t save all the things that need an external ref to work ?

@haze said: Don't save all the things that need an external ref to work ?

I’m not sure I can be selective, considering how a save call works against a node/control/etc.

For instance, I call save on the control, which in turn save all emitters within the array list. At that point (unless I omit this from the emitter itself) it is out of my hands. And if someone isn’t using the builder, it is likely to cause mass confusion.

EDIT: Though, maybe the problem isn’t as big as I think. If you load the j3o, the mesh is only being loaded once. At this point, you could clone the control, retrieve the emitter in question and replace the emitter shape. I might be over-thinking this… maybe.

@t0neg0d said: Actually,

Concerning saving to j3o format, I have an issue that I could use some brain-power behind.

Using an animated mesh as an emitter shape… why is this an issue? Well, let me explain the depths of my woes:

This feature is more useful than you might initially think and here is why:

  • You have a character in your game
  • You’re character is hold two super cool, awesome rare weapons, that require particle emitters to show exactly how cool and awesome they are
  • You want one to show animated electrical discharges that climb the length of the blade
  • it will require you to set the emitter shape to the instance of the loaded mesh… why? Because when you animate the character, you probably don’t want to have to animate a second copy of that mesh in the emitter. You’ll want to set the emitter shape to actual mesh loaded for the character and just manage that model’s animations.

So what is the problem?

If the project is saved as a j3o and loaded this way, the mesh associated with the emitter will be loaded as well… though the actual mesh being loaded is completely useless and doing nothing more than eating up resources.

Yeah, you can retrieve the emitters from the control and change the shape to the new instance, but you still have the emitter mesh being loaded for no reason.

Anyone have any thoughts on how to bypass this issue?

Why can’t the emitter grab the mesh at runtime? I mean at some point it will have to be loaded anyway?

1 Like