  | | | Particle Goals plugin finally done and submited, sorry about the wait. | Particle Goals plugin finally done and submited, sorry about the wait. 2004-04-17 - By lpiasecki76
Back I know I promised this a while ago. Unfortunately last year of school proved to be hectic.
hopefully the exams will be easy and then I'm off to looking for a job :-).
I just got a few hours tonight to finish it. This is my first script/plug-in.
Without any modesty I think it's better than Maya's goals, although slower :-).
I submitted it to XSINET, the reference is 2737. I guess it will be reviewed and posted.
I also tried to post it on XSIBase, but it seems that I need to give it html link to my web site, which I don't have. I'm not certain if I can upload the file somehow to XSI Base.
Anyway, enjoy and if you have any questions or suggestions or ideas for particle plug-ins and behaviours, let me know, but keep in mind that I'm just starting XSI scripting, although I do have fairy good understanding of math and graphics, just have to learn the XSI api :-).
Here's the content of the index.html file included with the ParticleGoals plugin/script:
Plug-in name: ParticleGoalsV1
Author: Luke Piasecki
Copyright April 2004
General notes:
Sorry it took so long for the plug-in. It took me about 15 hrs to code it. I'm writing the docs at 5am, so there might be a lot of mistakes.
This was my first XSI script, so it's far from perfect. If you have any suggestions, bugs etc. email me at lpiasecki76@(protected)
I only have access to XSI at school, so updates might be slow to come. Again, sorry about the wait, but I was swamped with school work and such.
I assume no responsibility for any damage in anyway caused by use of this plug-in :-). Gotta say it, sorry: use at your own risk.
Description:
This simple plug-in was designed to simulate and extent the functionality of particle goals found in Alias Maya software.
Some of the features:
- Any object can be used as a goal, including nurbs, polygons, and other particle clouds! All these can be animated, including their history.
- Speed to the goal can be adjusted
- Randomization of goal per particle is supported
- Particles can be made to randomly flock around object
- Don't forget to make you goal object a collision object, for some cool effects or animate the goal object history.
- All goal parameters can be animated
- Offset from objects surface can be set
- Particles can have their goal weight decreased with their age
- Particles can use part of object as a goal
Installation:
Drag the 'LukesParticleGoalsV1.xsiaddon' onto XSI workspace.
Usage:
- Select a simulated cloud of particles
- Go to View>Custom Toolbars > Particles
- Click on the 'SetupGoals' button
- Select a nurbs, polygon or another particle cloud as the goal object
Your goal object will have a custom property set called 'ParticleGoal'. Play with the parameters. You might want to turn off command logging to speed up the particles.
Limitations:
I wish we could have some global per particle data. It would let me distribute the particles around the object and have the remember their position.
In the current implementation, the particles will only use vertices and points (or other particles) as the goal positions.
This same limitation applies to 'RandomizeGoalPoints' parameter. A particle will switch its goal vertex every frame. I can't make it remember which vertex it has and add some kind of structure and more control over intervals of switching goal points.
When you turn on 'WiggleAroundPoints' make sure you increase 'SpeedToGoal'.
Finally, the 'RandomizeGoalStrength' is not working the way I would like to. I'll take a look at it someday, but feel free to change, modify, hack the code to your liking.
Ability to use part of object as the goal is quite limited to how XSI stores the points in the point array. For instance, if you choose to only cover 10% of the object, which has 100 points, it will be the first 10 points in the point array.
Surface offset must be set to 1 for the particles to cover the surface... so just pretend its 0. So 1 for 0 offset :-).
If you have multiple goal objects acting at the same time, the particles will assume a position which is a blend between the goals. If you want the particles to go from one goal to another, animate the SpeedToGoal attribute.
I have not fully tested this with complex objects!
Future additions:
- Implement ability to use weight maps to paint the goals
- Have the particles cover the whole object, not just it's vertices
- Lots more ideas, just too little time :-).
Brief description of the parameters:
SpeedToGoal - self explanatory
SurfaceOffset - self explanatory
RandomizeGoalPoints - particle will switch its goal vertices each frame
PercentOfPoints - percent of points to consider for goals. For instance, if you set it to 50%, and your object is primitive>sphere, particles will cover half of the sphere
Under_OverShoot - particles will overshoot their target and then comeback in a spring-like behaviour. If this number is negative they will slow down as they approach the goal
ParticleAgeAffectsGoal - the older the particle, the slower it gets, just like all of us :-)
Randomize... parameters - self explanatory
Wiggle around points - particle will never stick to a point, but more so, they will wiggle around it :-) Not sure what this is useful for, but wiggling is cool!
Experiment and enjoy!
This plug-in can be used to simulate a lot of forces and particles behaviour that could not be done otherwise.
Not if we only could get hyper voxel-like rendering :-(.
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas -microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office :smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <meta name=Generator content="Microsoft Word 11 (filtered medium)"> <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="time"/> <!--[if !mso]> <style> st1\:*{behavior:url(#default#ieooui) } </style> <![endif]--> <style> <!-- /* Font Definitions */ @(protected) {font-family:Wingdings; panose-1 (See http://ose-1.ora-code.com):5 0 0 0 0 0 0 0 0 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} p {mso-margin-top-alt:auto; margin-right:0cm; mso-margin-bottom-alt:auto; margin-left:0cm; font-size:12.0pt; font-family:"Times New Roman";} span.EmailStyle17 {mso-style-type:personal-compose; font-family:Arial; color:windowtext;} @(protected) Section1 {size:21.0cm 842.0pt; margin:72.0pt 89.85pt 72.0pt 89.85pt;} div.Section1 {page:Section1;} --> </style>
</head>
<body lang=EN-CA link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>I know I promised this a while ago. Unfortunately last year of school proved to be hectic.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>hopefully the exams will be easy and then I’m off to looking for a job </span></font><font size=2 face=Wingdings><span style='font-size:10.0pt;font-family:Wingdings'>J</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>.<o:p></o:p></span> </font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>I just got a few hours tonight to finish it. This is my first script/plug-in.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>Without any modesty I think it’s better than Maya& #8217;s goals, although slower </span></font><font size=2 face=Wingdings><span style='font-size:10.0pt;font-family:Wingdings'>J</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>.<o:p></o:p></span> </font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>I submitted it to XSINET, the reference is 2737. I guess it will be reviewed and posted.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>I also tried to post it on XSIBase, but it seems that I need to give it html link to my web site, which I don’t have. I’m not certain if I can upload the file somehow to XSI Base.<o:p></o:p></span></font>< /p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>Anyway, enjoy and if you have any questions or suggestions or ideas for particle plug-ins and behaviours, let me know, but keep in mind that I’m just starting XSI scripting, although I do have fairy good understanding of math and graphics, just have to learn the XSI api </span>< /font><font size=2 face=Wingdings><span style='font-size:10.0pt;font-family:Wingdings'>J< /span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>.<o:p></o:p> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>Here’s the content of the index.html file included with the ParticleGoals plugin/script:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Plug-in name: </span></font></b>ParticleGoalsV1<o:p></o:p></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Author: </span></font></b>Luke Piasecki<b><span style='font-weight:bold'> </span></b><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>Copyright April 2004<o:p></o:p></span></font></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>General notes:</span></font></b><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>Sorry it took so long for the plug-in. It took me about 15 hrs to code it. I'm writing the docs at <st1:time Minute="00" Hour="5" w:st="on">5am</st1:time>, so there might be a lot of mistakes.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>This was my first XSI script, so it's far from perfect. If you have any suggestions, bugs etc. email me at <a href="mailto:lpiasecki76@(protected)">lpiasecki76 @(protected)</a><o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>I only have access to XSI at school, so updates might be slow to come. Again, sorry about the wait, but I was swamped with school work and such.<o:p></o:p></span>< /font></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>I assume no responsibility for any damage in anyway caused by use of this plug-in </span></font></b><b><font face=Wingdings><span style='font-family:Wingdings;font-weight:bold'>J</span></font>. Gotta say it, sorry: use at your own risk. <o:p></o:p></b></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Description:</span></font></b><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>This simple plug-in was designed to simulate and extent the functionality of particle goals found in Alias Maya software.<o:p></o:p></span></font></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Some of the features:</span></font></b><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Any object can be used as a goal, including nurbs, polygons, and <u>other particle clouds! </u>All these can be animated, including their history.<o:p></o:p>< /span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Speed to the goal can be adjusted<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Randomization of goal per particle is supported<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Particles can be made to randomly flock around object<o:p></o:p></span></font>< /p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Don't forget to make you goal object a collision object, for some cool effects or animate the goal object history.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- All goal parameters can be animated<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Offset from objects surface can be set<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Particles can have their goal weight decreased with their age<o:p></o:p></span> </font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Particles can use part of object as a goal<o:p></o:p></span></font></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Installation:</span></font></b><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>Drag the 'LukesParticleGoalsV1.xsiaddon' onto XSI workspace.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> <o :p></o:p></span></font></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Usage:</span></font></b><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> - Select a simulated cloud of particles<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> - Go to View>Custom Toolbars > Particles<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> - Click on the 'SetupGoals' button<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> - Select a nurbs, polygon or another particle cloud as the goal object<o:p></o:p> </span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>Your goal object will have a custom property set called 'ParticleGoal'. Play with the parameters. You might want to turn off command logging to speed up the particles.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> <o :p></o:p></span></font></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Limitations:</span></font></b><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>I wish we could have some global per particle data. It would let me distribute the particles around the object and have the remember their position.<o:p></o:p>< /span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>In the current implementation, the particles will only use vertices and points (or other particles) as the goal positions. <o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>This same limitation applies to 'RandomizeGoalPoints' parameter. A particle will switch its goal vertex every frame. I can't make it remember which vertex it has and add some kind of structure and more control over intervals of switching goal points.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>When you turn on 'WiggleAroundPoints' make sure you increase 'SpeedToGoal'.<o:p></o:p>< /span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>Finally, the 'RandomizeGoalStrength' is not working the way I would like to. I'll take a look at it someday, but feel free to change, modify, hack the code to your liking.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>Ability to use part of object as the goal is quite limited to how XSI stores the points in the point array. For instance, if you choose to only cover 10% of the object, which has 100 points, it will be the first 10 points in the point array.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>Surface offset must be set to 1 for the particles to cover the surface... so just pretend its 0. So 1 for 0 offset :-).<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>If you have multiple goal objects acting at the same time, the particles will assume a position which is a blend between the goals. If you want the particles to go from one goal to another, animate the SpeedToGoal attribute.<o:p></o:p></span>< /font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>I have not fully tested this with complex objects!<o:p></o:p></span></font></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Future additions:</span></font></b><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Implement ability to use weight maps to paint the goals<o:p></o:p></span></font ></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Have the particles cover the whole object, not just it's vertices<o:p></o:p></span>< /font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>- Lots more ideas, just too little time :-). <o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> <o :p></o:p></span></font></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Brief description of the parameters:</span></font></b><o:p>< /o:p></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>SpeedToGoal </span></font></b>- self explanatory <o:p></o:p>< /p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>SurfaceOffset </span></font></b>- self explanatory <o:p></o:p ></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>RandomizeGoalPoints </span></font></b> - particle will switch its goal vertices each frame<o:p></o:p></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>PercentOfPoints - </span></font></b>percent of points to consider for goals. For instance, if you set it to 50%, and your object is primitive>sphere, particles will cover half of the sphere<o:p></o:p></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Under_OverShoot - </span></font></b>particles will overshoot their target and then comeback in a spring-like behaviour. If this number is negative they will slow down as they approach the goal<o:p></o:p></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>ParticleAgeAffectsGoal </span></font></b>- the older the particle, the slower it gets, just like all of us :-)<o:p></o:p></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Randomize... parameters </span></font></b>- self explanatory <o:p></o:p></p>
<p><b><font size=3 face="Times New Roman"><span style='font-size:12.0pt; font-weight:bold'>Wiggle around points - </span></font></b>particle will never stick to a point, but more so, they will wiggle around it :-) Not sure what this is useful for, but wiggling is cool!<o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> <o :p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>Experiment and enjoy!<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>This plug-in can be used to simulate a lot of forces and particles behaviour that could not be done otherwise.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>Not if we only could get hyper voxel-like rendering :-(.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> <o :p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
|
|
 |