Beaut work FD, wonderful to see users take things into another dimension.
Not so much "another dmension" as a "Fractal Dimensia" :D
If only had time to play - oh well. Thanks so much for doing this, I'll have time about June 2014 , by then you'll be hosting large scale mock attacks at Pearl harbour if I guess right. Hope that's not impoliticaily incorrect picking PH
Yes, I actually thought of a PH sequence. Airplanes in air fights, torpedoes moving through the water at ships (attractors), etc. That would be fun!
I have already started working on an Apache helicopter attack animation. This sequence will push PySwarm in a couple of areas:
(1) Example use of a moving attractor
(2) Use of multiple BOIDs (helicopters and missiles)
(3) Multiple time sequences (helicopters flying, followed by missiles being launched from a platform, helicopters flying away)
Oh wait... Darn, I just gave away the story line!...
I've been thinking a lot about the limitation of PyCarrara and the necessity to modify scripts to get something, which is fine for an old IT guy like me, but may rebuke people with a more artistic mind :-)
When I saw the shark tank video and the use of ERC, I remembered that Fabaone has imagined helpers for ERC. If you mix that with the fact that PyCarrara can memorize informations across frames (like in the RobotWalk sample screen) and every object can be moved/rotated by a modifier, , I think I may at least try to build a solution where no script or a minimum of is necessary.
I could also make use of ERC sliders but it would require people to buy ERC (which, OTOH, is a good product and I recommend it)
Anyway, I start building a prototype and will report any progress (or lack of it :-) )
This sounds like a great idea, Philemo!
I have been hesitant linking PySwarm too much into ERC, because I thought there might be people who did not want to buy ERC to use PySwarm; though, as you mention, I can't imagine anyone doing serious animation without ERC. It's an essential tool. PyCarrara already excludes Mac users, which is really unfortunate. But all this is early. I'm excited to see where all this goes!
Again, looking forward to seeing how this proceeds.
Does this mean that you could have a settlings panel for PySwarm to set up the various parameters without needing to go back and forth between Carrara and a text editor - that would be a wonderful addition!
I've considered a lot of different directions PySwarm might go. And I'd like to see different variations in the near future pursued to make the features of what PySwarm could offer more readily accessible to every Carrara users. With that in mind, my thought is that ultimately PySwarm may need to be its own plug-in. I spent some time studying PyCloid, and even did some email exchanges with Frederic, and while PyCloid could be modified to make particles more "intelligent," it has its own limitations - which is the extent PyCloid particles can be animated.
I'm not sure I've shared this thought in other posts, but I imagine having a PySwarm plug-in, which adds its own replicator object. All of the parameters (those now and many more) would be available through a "PySwarm replicator" modeler window. No more scripts, no more text editing, no more creating lots of BOID instances - just an "add" list to add objects to the BOID list, sliders, buttons, and check boxes, with results immediately accessible through the animation scrubber. I can't currently think of an easier interface or a more fun way to do this.
Philemo's investigation might be a step in that direction!
One more thought on this. Having spent a lot of time running tests against the PySwarm scripts, I realize the "clunkiness" of this approach.
But a text script has (at least) one advantage at this point in PySwarm's lifecycle. It is easy to modify, fix, enhance, and experiment with new ideas. I'd like to think of the current edition of PySwarm as a prototype of the end result - a simple-to-use system of features available to every Carrara animator. Achieving that would be my ultimate definition of its success.
While it is wonderful that you have already got as far as you have, giving Carrara users a useful tool for creating lifelike animations, the additon of a parameters panel and as you say, having PySwarm create it's own duplicates, would be a fantastic end goal and make the whole thing very accessible and interactive. I have been liaising with Sparrowhawke to create a shader addition that allows each duplicated instance of an object to have its own colours etc. too so that would also tie in nicely!
Does this mean that you could have a settlings panel for PySwarm to set up the various parameters without needing to go back and forth between Carrara and a text editor - that would be a wonderful addition!
Yes, that's the spirit.
I would like to create a toolbox for PyCarrara, to allow someone who develop a nice script to distribute it in a user friendly way. The first user of that toolbox would be PySwarm
I would have several control boxes, one for the simulation, one for a boid, one for a container, one for an obstacle ...
Attaching a box to an object would mark it (so no need to write that in the script) and numerical and boolean parameters could be set using those controls
Another example
I've developed a tool in python to retarget animations (for human like body) from one skeleton to another skeleton (for instance poser to g4, g4 to genesis...) without any feet slippage even if the size are different.
The idea would be to import a Carrara file containing two groups (model and target) and a control box.
You drag and drop the model and the target under that groups, activate the control box and Voilà...
I'm not there yet, but I will try wery hard to do that.
Great to see this, I look forward to more. A couple of suggestions - Holly mentioned previously about the shadows looking too much like the actual objects and that is the case here, it almost looks like you have pairs of sharks, you need to reduce the shadow intensity (or have another light at a different angle that will add some illumination in the shadowed areas).
Yes, you and Holly are correct. I made adjustments to the original test file; just need to remember that for others as well. (Still new to animation.) Or maybe its an effect of staring at sequences makes me blind to this. :-)
I'm replacing the demo with a new version that uses buffers (very rough). I do believe it helps. Here is the link to the remake. http://youtu.be/_NbaQNNwfTg
Also the sharks' swimming motion looked too subtle, it needs to be exagerated more so that it is more visible. It will be be interesting to see your development to insert key frames!
The animation rate and extension of the tail was based on watching these videos. However, it is easy enough to make the animation more exaggerated, or adjust the rate.
Instead of doing that, I inserted a camera in the middle of the "shark tank" and added a brief footage clip of swimming up close. I hope that helps!
Does this mean that you could have a settlings panel for PySwarm to set up the various parameters without needing to go back and forth between Carrara and a text editor - that would be a wonderful addition!
Yes, that's the spirit.
I would like to create a toolbox for PyCarrara, to allow someone who develop a nice script to distribute it in a user friendly way. The first user of that toolbox would be PySwarm
I would have several control boxes, one for the simulation, one for a boid, one for a container, one for an obstacle ...
Attaching a box to an object would mark it (so no need to write that in the script) and numerical and boolean parameters could be set using those controls
Another example
I've developed a tool in python to retarget animations (for human like body) from one skeleton to another skeleton (for instance poser to g4, g4 to genesis...) without any feet slippage even if the size are different.
The idea would be to import a Carrara file containing two groups (model and target) and a control box.
You drag and drop the model and the target under that groups, activate the control box and Voilà...
I'm not there yet, but I will try wery hard to do that.
I'm very interested in seeing how this plays out as well. Retargeting animations would make the process a lot easier, and provide animators with a lot more flexibility.
Great to see this, I look forward to more. A couple of suggestions - Holly mentioned previously about the shadows looking too much like the actual objects and that is the case here, it almost looks like you have pairs of sharks, you need to reduce the shadow intensity (or have another light at a different angle that will add some illumination in the shadowed areas).
Yes, you and Holly are correct. I made adjustments to the original test file; just need to remember that for others as well. (Still new to animation.) Or maybe its an effect of staring at sequences makes me blind to this. :-)
I'm replacing the demo with a new version that uses buffers (very rough). I do believe it helps. Here is the link to the remake, which will be available about 2 PM ET USA today (about 15 minutes from this posting). http://youtu.be/_NbaQNNwfTg
Also the sharks' swimming motion looked too subtle, it needs to be exagerated more so that it is more visible. It will be be interesting to see your development to insert key frames!
The animation rate and extension of the tail was based on watching these videos. However, it is easy enough to make the animation more exaggerated, or adjust the rate.
Instead of doing that, I inserted a camera in the middle of the "shark tank" and added a brief footage clip of swimming up close. I hope that helps!
A definite improvement - thanks for taking the suggestions on board - and the close-up footage adds a lot.
Fixes made with V0.4.1 are:
1) BOIDs should now track moving attractors (e.g., target helper).
2) MAX_TURN clipping (when it occurs) is correctly being used in computing the new velocity.
3) Banking now works correctly when speed is clipped.
4) Fixed a problem in the initial velocity option 1 setting
5) A slight modification to how SEPARATION rule works
Hello FD,
I took your advice well and even tested all the other modifiable parameters: they is marvellous, one would spend the hours to see all that one can do with Pyswarm!
I tested 2 groups of boids in collisions and that does not work too badly except some rare nonsimilar interlacings of boids (you have to add a text for your future improvements which will be the welcomes!)
2 questions:
- How can we do for not that news keyframes be created for the main camera and camerafocus?
- I don't believe that the physical parameters of the scene influence the boids, considering they have keyframes, but the parameters of materials (Density, bounce, friction)?
Now that I have the principle in the head, I will start to study your very instructive project of helicopters, it should be a good base for future personal projects.
Sorry, still a small question: can I have the link of Pyswarm 0.4.1 (or more recent)?
Thank you.
Thank you, DUDU, for your thoughts and feedback. I'll try to answer your questions as best as possible. Please let me know if I did not answer them.
1) How can we do for not that news keyframes be created for the main camera and camerafocus?
If I understand, you do not want keyframes inserted for your camera and camera focus? To NOT add keyframes, just remove the names of the camera and focus from the lines containing them. The result should look something like this when you do:
2) I don't believe that the physical parameters of the scene influence the boids, considering they have keyframes, but the parameters of materials (Density, bounce, friction)?
That is correct. PySwarm only works with the BOIDs. If you have other objects in the scene, it does not recognize them directly. So BOIDs will fly/swim through floors, walls, and other objects (like ghosts!). The CONTAINMENT rule is used to tell PySwarm how to limit BOID motion. In later versions, you will be able to set more than one containment field.
3) Sorry, still a small question: can I have the link of Pyswarm 0.4.1 (or more recent)?
You can always find the latest version of PySwarm in the first post of this thread.
Until now, I made my tests with simple cones.
I tested with fishes, but those run with the tail in front (if for a man it's normal, not for a fish!).
I remade tests with sharks, those have the head up…
What do I have to make?
PySwarm assumes that your BOIDs are facing towards the +X axis. So you will need to re-orient your objects so that they are pointing in that direction. You will not be able to simply ROTATE them in the Assemble room, as this only changes the Transform Rotation values.
If your objects were created as vertex objects, the solution is straightforward. Just select one of the BOID objects, and go into the Vertex Modeling room. Remember to edit the Master object so that you will be changing all instances of the BOID object. Then rotate the object so it is facing in the +x direction.
If your object was not created as a vertex object (for example, it is a group of other objects), the solution is not so easy. But not impossible! One solution I found that works is to follow these steps:
1. Select all of your BOIDs (drag and highlight them)
2. Group them together (CTRL-G)
3. Select the GROUP object (not the individual BOIDs), and rotate the GROUP so that the BOIDs are facing in the +x axis
4. Once you have the BOIDs facing correctly, then select the individual BOIDs again and drag them out of the GROUP object
5. Delete the (empty) GROUP object
Hi FD,
Thank you for your answers, I will be able to continue my experiments…
You requests why I do not want a news keyframes, it is because I make tests with two different groups of boids in the same scene and I want to keep my keyframes from my first script charged.
Thank you for your explanations concerning the orientation of the boids, I used Carrara objects and the axes are not in the standart 3D.
Did you have time to look for my questions in connection with Pycarrara (that's not urgent !) or do you have a link for a tutorial ?
Thank you once more!
He He, I forgot a question: how can one program the length of the sequence?
If I understand your question, to run PySwarm for the entire length of a video sequence, set the following parameters to the start and end times:
sim_start_time = 0.0 # Set to be the start time of the simulation run (in seconds)
sim_end_time = 60.0 # Set to be the end time of the simulation run (in seconds)
In this example above, PySwarm will run the BOID simulation starting at time 0.0 seconds and stop at time 60.0 seconds (or 1 minute).
If your sequence is 5 minutes (5 x 60 = 300 seconds), then you would use:
sim_end_time = 300.0 # Set to be the end time of the simulation run (in seconds)
Here my first quick test with the fabulous “Pyswarm Script” of Fractal Dimensia and carried out in Carrara 3D.
Thank you FD to have made me known that !
An excellent start, DUDU! It looks like you're making great progress in getting PySwarm to work. =) The scene settings also look very nice!
Mostly, though, I am VERY pleased someone has taken this to the next step! And helps motivate me to make the next set of improvements! I look forward to seeing more.
If I can make a few suggestions...
If you're not using SPEED_LIMIT, you might find it useful to keep the sharks from swimming too fast. If you are using the rule, you might try a smaller maximum speed value.
Also, I found when doing my "Shark Tank" test, I set the FPS value to 1 (I think). This will force PySwarm to only generate 1 keyframe per second. This should help reduce the up/down jerky motion, as it looks like you have the FPS value to set to be a higher value (or you increased the video frame rate).
Continuing to make fixes and incremental improvements to this tool, I have released a slightly improved version of PySwarm - Version 0.4.2.
Included in this release are:
PySwarm V0.4.2.py - The Python script
PySwarm V0.4.2 User Guide.PDF - A slightly updated version of the V0.4 users guide
PySwarm V0.4.2 Test Scene.CAR - A simple test scene created with the basic PySwarm script to demonstrate PySwarm's abilities (with all 8 rules active).
Changes with this release include:
1) The ability to initiate BOIDs in landed mode. With a new parameter, you can now force BOIDs to remain stationary for a random amount of time (between the LANDED rule's min and max timing values). I used this new parameter to create a missile launch sequence shown here: https://www.youtube.com/watch?v=FMMaxzk7lDo
2) A new Max Acceleration parameter, useful in creating realistic BOID acceleration (including turning). Setting this value to a number other than 0 (zero) will cause PySwarm to "clip" BOIDs' change in velocity.
3) Several internal adjustments and fixes were made to improve motion and operations.
This will be the last refinement before I release Version 0.5 later this month, which will include 1-2 new rules.
Thought I would share a brief update on PySwarm V0.5.
As I began restructuring both the Python script and the Users' Guide for new features and capabilities, I realized it was time to give PySwarm a major face lift. With V0.5, along with several feature enhancements, I will be releasing a Windows application that completely redefines how the PySwarm parameters are set, and making the use of PySwarm even easier. With the new version, users will no longer have to edit parameters in a text file. Instead, they will do so through this application.
Once all of the parameters have been set, a simple click of a button will generate the Python script using the parameters as set, and making the script immediately available to import into your Carrara scene.
See attached sample screenshots of the application's user interface.
The purpose of this application is to prototype the interface for a PySwarm plug-in, currently being studied by Philemo.
My plan is still to have PySwarm V0.5 available later this month.
FD - that looks terrific. I was particularly excited to see the multiple containment zones, this will enable users to set up so that it avoids objects as well as keep objects within a zone - I remember seeing a bird simulation many years ago (and I'm talking decades!) where the birds flew around and between buildings and being very impressed! And here we can produce our own versions. Great stuff, keep up the wonderful work!
FD - that looks terrific. I was particularly excited to see the multiple containment zones, this will enable users to set up so that it avoids objects as well as keep objects within a zone - I remember seeing a bird simulation many years ago (and I'm talking decades!) where the birds flew around and between buildings and being very impressed! And here we can produce our own versions. Great stuff, keep up the wonderful work!
Thanks, Phil. :-)
Good eyes! You caught one of the major enhancements with V0.5. Currently, I have it so you'll be able to define up to 10 containers with this next version - which can be any combination of "safe" and "restricted" zones. BOIDs will attempt to stay within safe zones (if they exist) while staying out of restricted zones.
I was imagining birds flying in a partially wooded region (like in Dartanbeck's environments) and steering around trees, where restricted cylinders are created. Another application would be creating a cityscape where people are walking on sidewalks and not in the streets or through building walls.
Depending on performance, I may bump the number of containers up to 50, but that may be done in a later version.
I am making rapid progress on completing PIA (PySwarm Interface App). Once it is near completion, I plan to create and post a video tutorial on how to use the app. That could occur as early as next weekend, barring unforeseen events.
Even better! I was thinking that you'd have to define several safe zones around an area you wanted to avoid, so having "restricted" zones as an extra option will be great! You are making such good progress - very impressed!
Even better! I was thinking that you'd have to define several safe zones around an area you wanted to avoid, so having "restricted" zones as an extra option will be great! You are making such good progress - very impressed!
Thanks once again, Phil.
Yes, the first test on multiple containments (zones) will be using the basic test scene in a 3D space with complex safe/restricted regions. I started mapping out scene last weekend and hope to finish scripting and start testing this weekend. However, this feature will be the last update I work on for V0.5, so lots to do before I get there!
I'll post the animation sequence when it is working.
Thought I'd take a breather from designing and coding PySwarm to give those interested on the status of V0.5. Given my current status, I can be much more precise as to what will be released with this next version.
V0.5 Enhancements:
1. PySwarm Interface App (PIA) - By far, the most time-consuming and (IMHO) the best feature with this upcoming release, PIA is a stand-alone application that runs on Windows systems, and replaces the need to edit text in the PySwarm Python script files. See my next post to this thread to read more about PIA and its status.
2. Multiple Containers - As described above, you will be able to define up to 10 containment regions. Each region will have its own shape (box, cylinder, or sphere), mode (safe or restricted), and strength.
3. Localization - In real life, individuals within large swarms (e.g., schools, flocks, herds) do not all move in unison. Individuals only react to others nearby. With V0.5, you will be able to set distance limitations on how some rules affect BOID motion - cohesion and alignment.
4. Distance Effects - Related to #2 above, the effects of cohesion and alignment can be reduced based on how far away the other BOIDs are.
5. PySwarm Script Redesign - Behind the scenes, I am completely restructuring the PySwarm script to make room for future enhancements. (Mostly, this is because I just started learning Python programming in October when I started PySwarm, and I want to make use of what I have learned since then.;) )
6. PySwarm Wiki - I will be releasing a link to an all-new guide and reference source for PySwarm. This will replace the current PySwarm Users Guide document. My hope is that others will also add to the site with what they have done with the script.
I hope to have the script redesign completed in the next few days, and finish up with the multi-container enhancement within the next week....
Here is some more information about the "PySwarm Interface Application" (PIA), what it does, and its status.
PIA is a Windows-based stand-alone application (".exe") that makes creating PySwarm scripts to import into your Carrara animations incredibly simple and easy to do. It also shortens the time it takes to go from PySwarm animation design to reviewing the animation in the Carrara sequencer. Further, other than having to install Python and the PyCarrara plug-in for Carrara, you will never even know there is any Python scripting involved!
PIA's intuitive interface makes it simple to select the PySwarm rules and other parameters you want to apply to your BOIDs animation. And when you are ready, PIA generates the PySwarm script automatically, ready to import into Carrara.
How PIA Works:
PIA builds the PySwarm script by inserting Python commands (for the parameter settings) into a script shell. The PySwarm shell is kept separate from the application (PIA) so that updates (bug fixes and minor enhancements) can be made to one without having to update the other.
Key Features:
1) You can manage up to 9 different projects at a time. Each project holds its own complete set of parameter settings.
2) PIA provides an easy, simple, and intuitive way of organizing the PySwarm parameters.
3) PIA uses tabbed pages, check-boxes, radio buttons, drop-down menus, and other features to simplify setting the PySwarm parameters.
4) PIA will perform a validation check of your parameter settings before generating the PySwarm script, and flag any errors. It will also warn you of any settings that may produce odd results.
5) Units of measure (e.g., seconds, feet, degrees) are clearly marked for each parameter.
6) PIA provides on-screen and context-sensitive help to assist you in understanding the rules and the parameters. For example, a brief description of a parameter will appear when you hover the cursor over the parameter's field.
7) PIA takes only a few minutes to install and set up on your computer. There is no Windows registration required, so installing updates is as easy as replacing the .exe file.
Status:
Coding of the application is complete. PIA is generating valid Python script and properly building PySwarm scripts from a shell.
Once I have completed redesigning the PySwarm script for V0.5, I will begin final testing of the app.
Wow!
Okay, PIA is looking like a totally cool addition! As much as it does not bother me in the slightest to edit your wonderful scripting by hand, per your instructions, I'd imaging that, by having PIA, you can actually eliminate a lot of the need for writing them, especially as the code gets more difficult to navigate. Being one whom enjoyed messing with scripts in NWN, it never bothers me to dig around where I need to - especially with instructions! :)
Oh my, but look at these new features! Fractal!
You Freaking R O C K ! ! !
Comments
Yes, I actually thought of a PH sequence. Airplanes in air fights, torpedoes moving through the water at ships (attractors), etc. That would be fun!
I have already started working on an Apache helicopter attack animation. This sequence will push PySwarm in a couple of areas:
(1) Example use of a moving attractor
(2) Use of multiple BOIDs (helicopters and missiles)
(3) Multiple time sequences (helicopters flying, followed by missiles being launched from a platform, helicopters flying away)
Oh wait... Darn, I just gave away the story line!...
This sounds like a great idea, Philemo!
I have been hesitant linking PySwarm too much into ERC, because I thought there might be people who did not want to buy ERC to use PySwarm; though, as you mention, I can't imagine anyone doing serious animation without ERC. It's an essential tool. PyCarrara already excludes Mac users, which is really unfortunate. But all this is early. I'm excited to see where all this goes!
Again, looking forward to seeing how this proceeds.
I've considered a lot of different directions PySwarm might go. And I'd like to see different variations in the near future pursued to make the features of what PySwarm could offer more readily accessible to every Carrara users. With that in mind, my thought is that ultimately PySwarm may need to be its own plug-in. I spent some time studying PyCloid, and even did some email exchanges with Frederic, and while PyCloid could be modified to make particles more "intelligent," it has its own limitations - which is the extent PyCloid particles can be animated.
I'm not sure I've shared this thought in other posts, but I imagine having a PySwarm plug-in, which adds its own replicator object. All of the parameters (those now and many more) would be available through a "PySwarm replicator" modeler window. No more scripts, no more text editing, no more creating lots of BOID instances - just an "add" list to add objects to the BOID list, sliders, buttons, and check boxes, with results immediately accessible through the animation scrubber. I can't currently think of an easier interface or a more fun way to do this.
Philemo's investigation might be a step in that direction!
One more thought on this. Having spent a lot of time running tests against the PySwarm scripts, I realize the "clunkiness" of this approach.
But a text script has (at least) one advantage at this point in PySwarm's lifecycle. It is easy to modify, fix, enhance, and experiment with new ideas. I'd like to think of the current edition of PySwarm as a prototype of the end result - a simple-to-use system of features available to every Carrara animator. Achieving that would be my ultimate definition of its success.
While it is wonderful that you have already got as far as you have, giving Carrara users a useful tool for creating lifelike animations, the additon of a parameters panel and as you say, having PySwarm create it's own duplicates, would be a fantastic end goal and make the whole thing very accessible and interactive. I have been liaising with Sparrowhawke to create a shader addition that allows each duplicated instance of an object to have its own colours etc. too so that would also tie in nicely!
Yes, that's the spirit.
I would like to create a toolbox for PyCarrara, to allow someone who develop a nice script to distribute it in a user friendly way. The first user of that toolbox would be PySwarm
I would have several control boxes, one for the simulation, one for a boid, one for a container, one for an obstacle ...
Attaching a box to an object would mark it (so no need to write that in the script) and numerical and boolean parameters could be set using those controls
Another example
I've developed a tool in python to retarget animations (for human like body) from one skeleton to another skeleton (for instance poser to g4, g4 to genesis...) without any feet slippage even if the size are different.
The idea would be to import a Carrara file containing two groups (model and target) and a control box.
You drag and drop the model and the target under that groups, activate the control box and Voilà...
I'm not there yet, but I will try wery hard to do that.
Sounds like some great developments - exciting times!
Actually, I spent an hour watching actual shark swimming footage, such as:
http://www.youtube.com/watch?v=iLHTtDbtDFA
The animation rate and extension of the tail was based on watching these videos. However, it is easy enough to make the animation more exaggerated, or adjust the rate.
Instead of doing that, I inserted a camera in the middle of the "shark tank" and added a brief footage clip of swimming up close. I hope that helps!
Yes, that's the spirit.
I would like to create a toolbox for PyCarrara, to allow someone who develop a nice script to distribute it in a user friendly way. The first user of that toolbox would be PySwarm
I would have several control boxes, one for the simulation, one for a boid, one for a container, one for an obstacle ...
Attaching a box to an object would mark it (so no need to write that in the script) and numerical and boolean parameters could be set using those controls
Another example
I've developed a tool in python to retarget animations (for human like body) from one skeleton to another skeleton (for instance poser to g4, g4 to genesis...) without any feet slippage even if the size are different.
The idea would be to import a Carrara file containing two groups (model and target) and a control box.
You drag and drop the model and the target under that groups, activate the control box and Voilà...
I'm not there yet, but I will try wery hard to do that.
I'm very interested in seeing how this plays out as well. Retargeting animations would make the process a lot easier, and provide animators with a lot more flexibility.
Actually, I spent an hour watching actual shark swimming footage, such as:
http://www.youtube.com/watch?v=iLHTtDbtDFA
The animation rate and extension of the tail was based on watching these videos. However, it is easy enough to make the animation more exaggerated, or adjust the rate.
Instead of doing that, I inserted a camera in the middle of the "shark tank" and added a brief footage clip of swimming up close. I hope that helps!
A definite improvement - thanks for taking the suggestions on board - and the close-up footage adds a lot.
The suggestion was a good one. Just don't assume my reaction is any indication I'm generally easy to deal with. ;)
I have uploaded a new version of PySwarm (V0.4.1) for public use. Here is that link:
https://drive.google.com/file/d/0B8V9-txK8F4MWmJWNWxnejRyazA/edit?usp=sharing
NOTE: You can always find the link to the latest version in the first post of this thread.
Fixes made to this version are based on the studies I have conducted so far described here:
http://www.daz3d.com/forums/discussion/32239/
Fixes made with V0.4.1 are:
1) BOIDs should now track moving attractors (e.g., target helper).
2) MAX_TURN clipping (when it occurs) is correctly being used in computing the new velocity.
3) Banking now works correctly when speed is clipped.
4) Fixed a problem in the initial velocity option 1 setting
5) A slight modification to how SEPARATION rule works
Thank you, DUDU, for your thoughts and feedback. I'll try to answer your questions as best as possible. Please let me know if I did not answer them.
1) How can we do for not that news keyframes be created for the main camera and camerafocus?
If I understand, you do not want keyframes inserted for your camera and camera focus? To NOT add keyframes, just remove the names of the camera and focus from the lines containing them. The result should look something like this when you do:
2) I don't believe that the physical parameters of the scene influence the boids, considering they have keyframes, but the parameters of materials (Density, bounce, friction)?
That is correct. PySwarm only works with the BOIDs. If you have other objects in the scene, it does not recognize them directly. So BOIDs will fly/swim through floors, walls, and other objects (like ghosts!). The CONTAINMENT rule is used to tell PySwarm how to limit BOID motion. In later versions, you will be able to set more than one containment field.
3) Sorry, still a small question: can I have the link of Pyswarm 0.4.1 (or more recent)?
You can always find the latest version of PySwarm in the first post of this thread.
I hope you find these answers helpful!
PySwarm assumes that your BOIDs are facing towards the +X axis. So you will need to re-orient your objects so that they are pointing in that direction. You will not be able to simply ROTATE them in the Assemble room, as this only changes the Transform Rotation values.
If your objects were created as vertex objects, the solution is straightforward. Just select one of the BOID objects, and go into the Vertex Modeling room. Remember to edit the Master object so that you will be changing all instances of the BOID object. Then rotate the object so it is facing in the +x direction.
If your object was not created as a vertex object (for example, it is a group of other objects), the solution is not so easy. But not impossible! One solution I found that works is to follow these steps:
1. Select all of your BOIDs (drag and highlight them)
2. Group them together (CTRL-G)
3. Select the GROUP object (not the individual BOIDs), and rotate the GROUP so that the BOIDs are facing in the +x axis
4. Once you have the BOIDs facing correctly, then select the individual BOIDs again and drag them out of the GROUP object
5. Delete the (empty) GROUP object
See screenshots below for details.
Hi FD,
Thank you for your answers, I will be able to continue my experiments…
You requests why I do not want a news keyframes, it is because I make tests with two different groups of boids in the same scene and I want to keep my keyframes from my first script charged.
Thank you for your explanations concerning the orientation of the boids, I used Carrara objects and the axes are not in the standart 3D.
Did you have time to look for my questions in connection with Pycarrara (that's not urgent !) or do you have a link for a tutorial ?
Thank you once more!
He He, I forgot a question: how can one program the length of the sequence?
If I understand your question, to run PySwarm for the entire length of a video sequence, set the following parameters to the start and end times:
sim_start_time = 0.0 # Set to be the start time of the simulation run (in seconds)
sim_end_time = 60.0 # Set to be the end time of the simulation run (in seconds)
In this example above, PySwarm will run the BOID simulation starting at time 0.0 seconds and stop at time 60.0 seconds (or 1 minute).
If your sequence is 5 minutes (5 x 60 = 300 seconds), then you would use:
sim_end_time = 300.0 # Set to be the end time of the simulation run (in seconds)
FD
Here my first quick test with the fabulous “Pyswarm Script” of Fractal Dimensia and carried out in Carrara 3D.
Thank you FD to have made me known that !
http://www.youtube.com/watch?v=34nyrqjE3_0
An excellent start, DUDU! It looks like you're making great progress in getting PySwarm to work. =) The scene settings also look very nice!
Mostly, though, I am VERY pleased someone has taken this to the next step! And helps motivate me to make the next set of improvements! I look forward to seeing more.
If I can make a few suggestions...
If you're not using SPEED_LIMIT, you might find it useful to keep the sharks from swimming too fast. If you are using the rule, you might try a smaller maximum speed value.
Also, I found when doing my "Shark Tank" test, I set the FPS value to 1 (I think). This will force PySwarm to only generate 1 keyframe per second. This should help reduce the up/down jerky motion, as it looks like you have the FPS value to set to be a higher value (or you increased the video frame rate).
Best,
FD
Thanks FD, one would say more of salmons that sharks, I will test your recommendations but I keep this script…
Thank you for your work!
Continuing to make fixes and incremental improvements to this tool, I have released a slightly improved version of PySwarm - Version 0.4.2.
Included in this release are:
PySwarm V0.4.2.py - The Python script
PySwarm V0.4.2 User Guide.PDF - A slightly updated version of the V0.4 users guide
PySwarm V0.4.2 Test Scene.CAR - A simple test scene created with the basic PySwarm script to demonstrate PySwarm's abilities (with all 8 rules active).
You can find the link to these files at the start of this thread:
http://www.daz3d.com/forums/discussion/31190/
This revision is based on my WIP study using the PySwarm script to create a helicopter and missile launch sequence described here:
http://www.daz3d.com/forums/discussion/32239/
Changes with this release include:
1) The ability to initiate BOIDs in landed mode. With a new parameter, you can now force BOIDs to remain stationary for a random amount of time (between the LANDED rule's min and max timing values). I used this new parameter to create a missile launch sequence shown here:
https://www.youtube.com/watch?v=FMMaxzk7lDo
2) A new Max Acceleration parameter, useful in creating realistic BOID acceleration (including turning). Setting this value to a number other than 0 (zero) will cause PySwarm to "clip" BOIDs' change in velocity.
3) Several internal adjustments and fixes were made to improve motion and operations.
This will be the last refinement before I release Version 0.5 later this month, which will include 1-2 new rules.
I ordered version 0.5 to Santa Claus ! ;-)
Thanks
Thought I would share a brief update on PySwarm V0.5.
As I began restructuring both the Python script and the Users' Guide for new features and capabilities, I realized it was time to give PySwarm a major face lift. With V0.5, along with several feature enhancements, I will be releasing a Windows application that completely redefines how the PySwarm parameters are set, and making the use of PySwarm even easier. With the new version, users will no longer have to edit parameters in a text file. Instead, they will do so through this application.
Once all of the parameters have been set, a simple click of a button will generate the Python script using the parameters as set, and making the script immediately available to import into your Carrara scene.
See attached sample screenshots of the application's user interface.
The purpose of this application is to prototype the interface for a PySwarm plug-in, currently being studied by Philemo.
My plan is still to have PySwarm V0.5 available later this month.
FD - that looks terrific. I was particularly excited to see the multiple containment zones, this will enable users to set up so that it avoids objects as well as keep objects within a zone - I remember seeing a bird simulation many years ago (and I'm talking decades!) where the birds flew around and between buildings and being very impressed! And here we can produce our own versions. Great stuff, keep up the wonderful work!
Thanks, Phil. :-)
Good eyes! You caught one of the major enhancements with V0.5. Currently, I have it so you'll be able to define up to 10 containers with this next version - which can be any combination of "safe" and "restricted" zones. BOIDs will attempt to stay within safe zones (if they exist) while staying out of restricted zones.
I was imagining birds flying in a partially wooded region (like in Dartanbeck's environments) and steering around trees, where restricted cylinders are created. Another application would be creating a cityscape where people are walking on sidewalks and not in the streets or through building walls.
Depending on performance, I may bump the number of containers up to 50, but that may be done in a later version.
I am making rapid progress on completing PIA (PySwarm Interface App). Once it is near completion, I plan to create and post a video tutorial on how to use the app. That could occur as early as next weekend, barring unforeseen events.
Even better! I was thinking that you'd have to define several safe zones around an area you wanted to avoid, so having "restricted" zones as an extra option will be great! You are making such good progress - very impressed!
Thanks once again, Phil.
Yes, the first test on multiple containments (zones) will be using the basic test scene in a 3D space with complex safe/restricted regions. I started mapping out scene last weekend and hope to finish scripting and start testing this weekend. However, this feature will be the last update I work on for V0.5, so lots to do before I get there!
I'll post the animation sequence when it is working.
Thought I'd take a breather from designing and coding PySwarm to give those interested on the status of V0.5. Given my current status, I can be much more precise as to what will be released with this next version.
V0.5 Enhancements:
1. PySwarm Interface App (PIA) - By far, the most time-consuming and (IMHO) the best feature with this upcoming release, PIA is a stand-alone application that runs on Windows systems, and replaces the need to edit text in the PySwarm Python script files. See my next post to this thread to read more about PIA and its status.
2. Multiple Containers - As described above, you will be able to define up to 10 containment regions. Each region will have its own shape (box, cylinder, or sphere), mode (safe or restricted), and strength.
3. Localization - In real life, individuals within large swarms (e.g., schools, flocks, herds) do not all move in unison. Individuals only react to others nearby. With V0.5, you will be able to set distance limitations on how some rules affect BOID motion - cohesion and alignment.
4. Distance Effects - Related to #2 above, the effects of cohesion and alignment can be reduced based on how far away the other BOIDs are.
5. PySwarm Script Redesign - Behind the scenes, I am completely restructuring the PySwarm script to make room for future enhancements. (Mostly, this is because I just started learning Python programming in October when I started PySwarm, and I want to make use of what I have learned since then.;) )
6. PySwarm Wiki - I will be releasing a link to an all-new guide and reference source for PySwarm. This will replace the current PySwarm Users Guide document. My hope is that others will also add to the site with what they have done with the script.
I hope to have the script redesign completed in the next few days, and finish up with the multi-container enhancement within the next week....
Still in time for the holidays! :)
Here is some more information about the "PySwarm Interface Application" (PIA), what it does, and its status.
PIA is a Windows-based stand-alone application (".exe") that makes creating PySwarm scripts to import into your Carrara animations incredibly simple and easy to do. It also shortens the time it takes to go from PySwarm animation design to reviewing the animation in the Carrara sequencer. Further, other than having to install Python and the PyCarrara plug-in for Carrara, you will never even know there is any Python scripting involved!
PIA's intuitive interface makes it simple to select the PySwarm rules and other parameters you want to apply to your BOIDs animation. And when you are ready, PIA generates the PySwarm script automatically, ready to import into Carrara.
How PIA Works:
PIA builds the PySwarm script by inserting Python commands (for the parameter settings) into a script shell. The PySwarm shell is kept separate from the application (PIA) so that updates (bug fixes and minor enhancements) can be made to one without having to update the other.
Key Features:
1) You can manage up to 9 different projects at a time. Each project holds its own complete set of parameter settings.
2) PIA provides an easy, simple, and intuitive way of organizing the PySwarm parameters.
3) PIA uses tabbed pages, check-boxes, radio buttons, drop-down menus, and other features to simplify setting the PySwarm parameters.
4) PIA will perform a validation check of your parameter settings before generating the PySwarm script, and flag any errors. It will also warn you of any settings that may produce odd results.
5) Units of measure (e.g., seconds, feet, degrees) are clearly marked for each parameter.
6) PIA provides on-screen and context-sensitive help to assist you in understanding the rules and the parameters. For example, a brief description of a parameter will appear when you hover the cursor over the parameter's field.
7) PIA takes only a few minutes to install and set up on your computer. There is no Windows registration required, so installing updates is as easy as replacing the .exe file.
Status:
Coding of the application is complete. PIA is generating valid Python script and properly building PySwarm scripts from a shell.
Once I have completed redesigning the PySwarm script for V0.5, I will begin final testing of the app.
Wow!
Okay, PIA is looking like a totally cool addition! As much as it does not bother me in the slightest to edit your wonderful scripting by hand, per your instructions, I'd imaging that, by having PIA, you can actually eliminate a lot of the need for writing them, especially as the code gets more difficult to navigate. Being one whom enjoyed messing with scripts in NWN, it never bothers me to dig around where I need to - especially with instructions! :)
Oh my, but look at these new features! Fractal!
You Freaking R O C K ! ! !