Digital Art Zone

 
   
1 of 22
1
PySwarm for PyCarrara (V0.6) Released 01/25/2013
Posted: 24 October 2013 06:04 PM   [ Ignore ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03

PySwarm for PyCarrara is a Python script specifically designed and written to be used with DAZ3D Carrara’s plug-in PyCarrara to manipulate and render realistic swarming object and other similar forms of group behavior in Carrara. (Read about how to install PyCarrara at the end of this post.)

Latest Version
V0.6 of PySwarm for PyCarrara is now available.

Access
You can get the latest information about downloading and installing the required components of PySwarm with the following link:
http://pyswarm.wikia.com/wiki/Download_and_installing_PySwarm#Latest_Version_of_the_PySwarm_Package

Note that PySwarm now comes with an installer package to make installation easier.

Be sure to follow the link to the wiki page on the installation procedure:
http://pyswarm.wikia.com/wiki/PySwarm_Installation_and_Removal_Procedures

Contents
The contents of the V0.6 package includes:
* Revised PIA (V2)
* New PySwarm script shell (V0.6)
* Six demo .CAR and PySwarm project parameter files to study, experiment, learn from, and expand

Note that PIA V1 and previous versions of PySwarm will no longer be supported.

V0.6 Enhancements:
The details of the modifications to this release can be found:
http://pyswarm.wikia.com/wiki/PySwarm_V0.6_Release_Notes

Online Users Guide
You can access the general Users Guide here:
http://pyswarm.wikia.com/wiki/PySwarm_Users_Guide_(Main_Page)

I will continue to expand the online guide.

To read about PIA, you can find a complete section here:
http://pyswarm.wikia.com/wiki/PySwarm_Interface_Application_(Main_Page)

I have started a troubleshooting page designed to offer suggestions when encountering problems with installing Python and PyCarrara, using PIA, and importing PySwarm scripts. I will continue to add to this page.
http://pyswarm.wikia.com/wiki/Troubleshooting_PySwarm


Special thanks to Philemo, who provided insights about how to code the MAX_TURNING rule, suggestions on CONTAINMENT coding, and ideas for redesigning the script. Anyone else interested in participating please post here or email me! My email address is:
.(JavaScript must be enabled to view this email address)

Also, special thanks to Philemo, Dartanbeck, PhilW, EP, DUDU, 0Oseven, and all those who have offered encouragements, ideas, and suggestions about how to advance this product. Please keep the thoughts and ideas coming! I look forward to seeing posts in this thread showing what you have done with PySwarm!

========================================================

Version History:
0.3:  Initial release (10/25/2013)
0.3.1: Bug fix when no camera or focus are used (10/25/2013)
0.3.2: Bug fix when using “Attractor” object (10/29/2013)
0.4:  New features added (11/4/2013)
0.4.1: Four bug fixes (11/18/2013)
0.4.2: Slight enhancements (12/11/2013)
0.5:  Major release (12/29/2013)
0.5.1: Bug fixes (01/02/2014)
0.5.2: Several enhancments and bug fixes (01/16/2014)
0.6:  Major release (01/25/2014)

I’ll continue to publish update releases and more demos to this thread in the future. This header post will provide links to the latest versions. Some of the features currently be working on are listed at the end of the Users Guide.

Support:
Please post any issues, comments, and questions you have about PySwarm in this thread.

Happy swarming!

 Signature 

The most complex object in mathematics, the Mandelbrot Set ... is so complex as to be uncontrollable by mankind and describable as ‘chaos’. — Benoit Mandelbrot

Profile
 
 
Posted: 24 October 2013 06:38 PM   [ Ignore ]   [ # 1 ]
Member
Rank
Total Posts:  249
Joined  2004-12-08

FD, 
This is great looking stuff .  Nicely done.

Profile
 
 
Posted: 24 October 2013 06:54 PM   [ Ignore ]   [ # 2 ]
Addict
Avatar
RankRankRankRank
Total Posts:  6469
Joined  2007-12-04

Fan-freaking-tastic!
Is it me… or was that really fast?!!! Doesn’t seem that long ago you’ve just begun this project. I had no clue I’d be downloading it so soon smile

Thank You FD!!!

 Signature 

Dartanbeck @ Daz3d          Check out the Carrara Cafe          ►►►  Carrara Information Manual   ◄◄◄

Profile
 
 
Posted: 24 October 2013 07:03 PM   [ Ignore ]   [ # 3 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
mmoir - 24 October 2013 06:38 PM

FD, 
This is great looking stuff .  Nicely done.

Thanks, mmoir. I hope you find it useful!

 Signature 

The most complex object in mathematics, the Mandelbrot Set ... is so complex as to be uncontrollable by mankind and describable as ‘chaos’. — Benoit Mandelbrot

Profile
 
 
Posted: 24 October 2013 07:10 PM   [ Ignore ]   [ # 4 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
Dartanbeck - 24 October 2013 06:54 PM

Fan-freaking-tastic!
Is it me… or was that really fast?!!! Doesn’t seem that long ago you’ve just begun this project. I had no clue I’d be downloading it so soon smile

Thank You FD!!!

Well, it took me 8 calendar days to get this far. I might need a few days off before I get started on the next round. smile

 Signature 

The most complex object in mathematics, the Mandelbrot Set ... is so complex as to be uncontrollable by mankind and describable as ‘chaos’. — Benoit Mandelbrot

Profile
 
 
Posted: 24 October 2013 10:10 PM   [ Ignore ]   [ # 5 ]
Addict
Avatar
RankRankRankRank
Total Posts:  6469
Joined  2007-12-04

You totally ROCK, my friend!

 Signature 

Dartanbeck @ Daz3d          Check out the Carrara Cafe          ►►►  Carrara Information Manual   ◄◄◄

Profile
 
 
Posted: 25 October 2013 03:02 AM   [ Ignore ]   [ # 6 ]
Active Member
Avatar
RankRank
Total Posts:  678
Joined  2009-12-08

Well done for bringing Python to life in this way. Keep going!

 Signature 

More 3D info and Pics at http://www.facebook.com/scififunk

Profile
 
 
Posted: 25 October 2013 03:07 AM   [ Ignore ]   [ # 7 ]
Member
Rank
Total Posts:  115
Joined  2008-08-08

Wauw, very good.

In the video most is in 2d (X,Y), is everything also possible with Z values?

Isn’t it possible for the ones not good with scripting, like me, to create it using an exe file? Insert values in a menu > create script.

Profile
 
 
Posted: 25 October 2013 03:47 AM   [ Ignore ]   [ # 8 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
Pjotter - 25 October 2013 03:07 AM

Wauw, very good.

In the video most is in 2d (X,Y), is everything also possible with Z values?

Isn’t it possible for the ones not good with scripting, like me, to create it using an exe file? Insert values in a menu > create script.

The goal is that PySwarm will work in all 3 dimensions, but I am just now testing motion in the z axis. There is still some work to do on that. At the moment, the individuals undulate as a group in the z axis as they move. I know why its happening that way; just not sure yet what is “wrong” with the behavior and how the best way to modify the script. I’m working on a simulation called “Shark Tank” to test this more.

I wrote the script so it is extremely easy to add PySwarm to your Carrara animations. All you need is to add the PyCarrara plug-in. If you don’t know anything about coding/scripting, just make adjustments to the parameters (near the beginning of the script), and ignore the details below. I have thought about writing a program that is more interactive, and then dumps a PySwarm script file using values set in a window; but that is farther downstream once the features and parameter set is more stable. smile

 Signature 

The most complex object in mathematics, the Mandelbrot Set ... is so complex as to be uncontrollable by mankind and describable as ‘chaos’. — Benoit Mandelbrot

Profile
 
 
Posted: 25 October 2013 04:03 AM   [ Ignore ]   [ # 9 ]
Power Member
RankRankRank
Total Posts:  1226
Joined  2005-04-12

Great work, I’ll certainly download this and have a play when I get the chance, this is a great development for the Carrara community!

Profile
 
 
Posted: 25 October 2013 04:12 AM   [ Ignore ]   [ # 10 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03

*** Update ***

It seems in all my testing of the script, I let a defect slip through. In V0.3, if you choose no camera or camera focus to manipulate, the script won’t work and Python aborts.

I’ve replaced the download link in the first post with a fix to this (V0.3.1), which is the same user guide and .CAR files, except with a modified PySwarm script file. Alternatively, you can download JUST the script file here:
https://drive.google.com/file/d/0B8V9-txK8F4MYW84ZV9ldzNzZ3c/edit?usp=sharing

 Signature 

The most complex object in mathematics, the Mandelbrot Set ... is so complex as to be uncontrollable by mankind and describable as ‘chaos’. — Benoit Mandelbrot

Profile
 
 
Posted: 25 October 2013 10:03 AM   [ Ignore ]   [ # 11 ]
Addict
Avatar
RankRankRankRank
Total Posts:  6469
Joined  2007-12-04

Now that’s customer support! Thanks, yet again!

 Signature 

Dartanbeck @ Daz3d          Check out the Carrara Cafe          ►►►  Carrara Information Manual   ◄◄◄

Profile
 
 
Posted: 25 October 2013 03:03 PM   [ Ignore ]   [ # 12 ]
Active Member
Avatar
RankRank
Total Posts:  678
Joined  2009-12-08

Well done.

Can I just clarify? Does this include collision detection? I’m thinking of a crowded corridor scene where people are bumping into each other.

 Signature 

More 3D info and Pics at http://www.facebook.com/scififunk

Profile
 
 
Posted: 25 October 2013 03:47 PM   [ Ignore ]   [ # 13 ]
Power Member
RankRankRank
Total Posts:  1226
Joined  2005-04-12

I think this is what the separation parameter is all about, it can be set so that people avoid each other - think of it like defining each actor’s personal space.

Profile
 
 
Posted: 25 October 2013 04:28 PM   [ Ignore ]   [ # 14 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
PhilW - 25 October 2013 03:47 PM

I think this is what the separation parameter is all about, it can be set so that people avoid each other - think of it like defining each actor’s personal space.

Good question, Steve.

And Phil’s response is correct. If you set the Separation adjustment (“keep_away_adj”) value low, the individuals do not seem to care much for their separation, and will walk on top of each other (so to speak). Very high values, and they do crazy things to avoid moving inside the personal space (the “keep_away_distance”). You would have to play with the parameters to see what works best.

Remember that the SEPARATION rule is sort of the reverse of COHESION. More precisely, COHESION gets the individuals to want to move to the center of their mass, while SEPARATION is a one-on-one rule - that one only takes effect when two individuals move in closer than the distance to another. Most of the jerkiness you might have seen in my demos is caused by this “state of confusion” between moving closer and staying away.

Of course, it is important to remember that PySwarm inserts keyframes. So once you get the individuals behaving “close enough,” you can go in and individually tweak where you have collisions.

Also, Steve, if you want to play around with how you might simulate people moving down a hallway, you might actually try this:
1) set the CONTAINMENT values to be just inside the corridor
2) turning off the COHESION rule completely (let CONTAINMENT force them to stay together)
3) set SEPARATION to a middle range
4) use the ATTRACTION rule to draw the people down the hallway (setting the ATTRACTION object at the other end)
5) remember to set the max_speed to be the walking speed (in feet per second), which for walking I estimate to be about 5.5 at a relatively fast walk, 4 for a stroll.

You can easily set these and use the .CAR test file (using the ball-like BOIDS) to test it out. Once you have that, replace the BOIDS with humans, and rerun the PySwarm script. That should get you close.

 Signature 

The most complex object in mathematics, the Mandelbrot Set ... is so complex as to be uncontrollable by mankind and describable as ‘chaos’. — Benoit Mandelbrot

Profile
 
 
Posted: 25 October 2013 10:03 PM   [ Ignore ]   [ # 15 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
FractalDimensia - 25 October 2013 04:28 PM

Also, Steve, if you want to play around with how you might simulate people moving down a hallway, you might actually try this:
1) set the CONTAINMENT values to be just inside the corridor
2) turning off the COHESION rule completely (let CONTAINMENT force them to stay together)
3) set SEPARATION to a middle range
4) use the ATTRACTION rule to draw the people down the hallway (setting the ATTRACTION object at the other end)
5) remember to set the max_speed to be the walking speed (in feet per second), which for walking I estimate to be about 5.5 at a relatively fast walk, 4 for a stroll.

Since this scenario fit the current improvements I am making to PySwarm, I spent a few hours putting together a quick render of this idea. I used the settings above. With a few more hours of tweaking, and giving the robots a walk cycle, this might start to look realistic…

http://youtu.be/RyG0p8qVGS4

 

 Signature 

The most complex object in mathematics, the Mandelbrot Set ... is so complex as to be uncontrollable by mankind and describable as ‘chaos’. — Benoit Mandelbrot

Profile
 
 
   
1 of 22
1