Particle Panel alternative

Return to Panda Features in Development

Particle Panel alternative

Postby wezu » Sun Mar 29, 2015 8:27 am

This is something I've been making in the last week, it's not finished but it's working:
Image

This is an alternative tool for making particle effects, it saves all the parameters in a json file (+some images), the rendering of the particles is assisted by a shader.

Manual:

When the script is lunched you will probably first see a white screen and all the panels - all the particles are initially rendered white, and the camera is zoomed in, just zoom out, the script uses the default mouse look.

UI:
Bottom rows (from top to bottom):
The buttons here show how the shape, size, color and transparency of the particles changes over their life time, the left side shows how they will look at the moment of their birth and the right side shows how they will look dieing.

-Shape:
There are 8 buttons/icons here (initially all white). Clicking one of them will show a pop-up window with available shapes, clicking a shape in that window assigns that shape at the given time. The shapes can be changed at will in any given moment. The eye icon in the far right can be used to hide/show this panel.
-Alpha:
There are 64 buttons here, forming a gradient. When you click any of them a pop-up widget, that will help select a value will be shown.
The widget will have a black and white gradient, an input field and two buttons labeled "Set Alpha" and "Remove Alpha". Click on the gradient to set a value and then confirm by pressing the "Set Alpha" button. If you prefer to input a value by hand, be sure to press enter after entering a value. The "Remove Alpha" button can be used to remove a previously set value.
To make things easy, you don't need to fill all the values, the script will automagically generate a smooth gradient between the values you've set.
The values you have set will be marked with a little circle.
The eye icon in the far right can be used to hide/show this panel.
-Color:
There are 64 buttons here, forming a gradient. When you click any of them a pop-up widget, that will help select a value will be shown.
The widget will have a color gradient, an input field and two buttons labeled "Set Color" and "Remove Color". Click on the gradient to set a value and then confirm by pressing the "Set Color" button. If you prefer to input a value by hand, be sure to press enter after entering a value. The "Remove Color" button can be used to remove a previously set value.
To make things easy, you don't need to fill all the values, the script will automagically generate a smooth gradient between the values you've set.
The values you have set will be marked with a little circle.
The eye icon in the far right can be used to hide/show this panel.
-Size:
There are 64 buttons here, forming a line. When you click any of them a pop-up widget, that will help select a value will be shown.
The widget will have a slider, an input field and two buttons labeled "Set Size" and "Remove Size". It works just like the color and alpha panels, but it plots a line showing how the size of the particles will change over time.
The values you have set will be marked with a red line.
The eye icon in the far right can be used to hide/show this panel.
-Save dir:
This panel shows where the particles are saved... editing options for this feature are on the TODO list.

Top part:
This shows the properties of the particle emitter. The Blend mode is not working at this point in time, the rest should be clear (if it's not -ask here).

There's some example code in vfx_loader.py how the effect could be loaded, but I haven't yet tested it :mrgreen:

VIDEO tutorial (making a waterfall):
https://www.youtube.com/watch?v=KscgDCk ... e=youtu.be

License:
Choose ont that you like:
CC0 or Beer ware license or GPL or MIT or BSD or BDSM (no wait, that's not a license)

Code:
Git:
https://github.com/wezu/koparka/tree/master/tools
Or zip:
Attachments
patric.zip
v0.1
(314.63 KiB) Downloaded 14 times
I may be totally wrong, cause I'm a dancin' fool.

NameError: global name 'elf' is not defined
User avatar
wezu
 
Posts: 919
Joined: Tue May 19, 2009 1:03 pm

Re: Particle Panel alternative

Postby stereoscopic » Wed Apr 01, 2015 10:53 am

Wow. Nice work. How do I save a ptf?
Here's to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes, the ones who see things differently.
stereoscopic
 
Posts: 74
Joined: Tue Jan 13, 2015 3:44 pm

Re: Particle Panel alternative

Postby wezu » Wed Apr 01, 2015 12:02 pm

The save/load function is a bit meh, at the moment. The editor will make a new dir each time you run it and save files there...but not a ptf.

I don't like the ptf format much... it's just a python script loaded with exec(). I don't think any 'asset' (be it a 3d model, image, sound or particle effect) should run arbitrary code.

Imagine someone making an mod for your game that will delete all files in your home directory every time a spell using a ptf is cast. Not a good idea.
I may be totally wrong, cause I'm a dancin' fool.

NameError: global name 'elf' is not defined
User avatar
wezu
 
Posts: 919
Joined: Tue May 19, 2009 1:03 pm

Re: Particle Panel alternative

Postby stereoscopic » Sat May 16, 2015 11:07 pm

Getting an error
python patric.py
Known pipe types:
CocoaGraphicsPipe
(all display modules loaded.)
:display:gsg:glgsg(error): An error occurred while compiling GLSL shader vfx_v.glsl:
ERROR: vfx_v.glsl:19: 'round' : no matching overloaded function found
:display:gsg:glgsg(error): An error occurred while compiling GLSL shader vfx_f.glsl:
ERROR: vfx_f.glsl:22: 'r' : field selection requires structure or vector on left hand side
Here's to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes, the ones who see things differently.
stereoscopic
 
Posts: 74
Joined: Tue Jan 13, 2015 3:44 pm

Re: Particle Panel alternative

Postby wezu » Sun May 17, 2015 1:13 am

That should be easy to fix - looks like there's no round() function in glsl 120, but there is a floor().


EDIT:
Bugfixed version:
Attachments
patric_17_05_2015.zip
(297.02 KiB) Downloaded 9 times
I may be totally wrong, cause I'm a dancin' fool.

NameError: global name 'elf' is not defined
User avatar
wezu
 
Posts: 919
Joined: Tue May 19, 2009 1:03 pm

Re: Particle Panel alternative

Postby stereoscopic » Sun May 17, 2015 7:50 am

Still giving me this error.
python patric.py
Known pipe types:
CocoaGraphicsPipe
(all display modules loaded.)
:display:gsg:glgsg(error): An error occurred while compiling GLSL shader vfx_f.glsl:
ERROR: vfx_f.glsl:22: 'r' : field selection requires structure or vector on left hand side
WARNING: vertex shader writes varying 'color' which is not active.
WARNING: vertex shader writes varying 'vpos' which is not active.
WARNING: vertex shader writes varying 'fog_factor' which is not active.
Here's to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes, the ones who see things differently.
stereoscopic
 
Posts: 74
Joined: Tue Jan 13, 2015 3:44 pm

Re: Particle Panel alternative

Postby wezu » Sun May 17, 2015 9:38 am

Another bugfix:
Attachments
patric2_17_05_2015.zip
(297.04 KiB) Downloaded 13 times
I may be totally wrong, cause I'm a dancin' fool.

NameError: global name 'elf' is not defined
User avatar
wezu
 
Posts: 919
Joined: Tue May 19, 2009 1:03 pm

Re: Particle Panel alternative

Postby stereoscopic » Thu May 28, 2015 5:31 pm

Can you give me an example of how to load an effect?
Here's to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes, the ones who see things differently.
stereoscopic
 
Posts: 74
Joined: Tue Jan 13, 2015 3:44 pm

Re: Particle Panel alternative

Postby wezu » Fri May 29, 2015 2:50 am

There should be a file called vfx_loader.py with the editor (if it's not you can use the one that's in the Koparka git https://github.com/wezu/koparka/blob/ma ... _loader.py). You may need to edit that file to point to the shaders that are needed if you moved them or if you have other shaders.

And now that I think of it, the loader tries to load a texture from '../partices/smoke1.png', so if you don't have a texture like that in a place like that, replace it with someting sane. I know it was a stupid thing to do but well...

Load the values from a json file (let's call the file effect.json) and let the createEffect function from vfx_loader do the rest:

Code: Select all
from vfx_loader import createEffect
import json

with open('effect.json') as f: 
    values=json.load(f)
particle_effect=createEffect(values)
#particle.start(parent=model, renderParent=render)
I may be totally wrong, cause I'm a dancin' fool.

NameError: global name 'elf' is not defined
User avatar
wezu
 
Posts: 919
Joined: Tue May 19, 2009 1:03 pm


Return to Panda Features in Development

Who is online

Users browsing this forum: No registered users and 0 guests