Digital Art Zone

 
   
7 of 22
7
PySwarm for PyCarrara (V0.6) Released 01/25/2013
Posted: 07 November 2013 05:54 AM   [ Ignore ]   [ # 91 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
head wax - 06 November 2013 09:54 PM

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!...

 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: 07 November 2013 06:02 AM   [ Ignore ]   [ # 92 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
Philemo - 07 November 2013 04:23 AM

Hi to all,

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 grin

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 grin )

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.

 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: 07 November 2013 06:27 AM   [ Ignore ]   [ # 93 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
PhilW - 07 November 2013 04:53 AM

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!

 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: 07 November 2013 06:43 AM   [ Ignore ]   [ # 94 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03

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.

 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: 07 November 2013 07:42 AM   [ Ignore ]   [ # 95 ]
Power Member
RankRankRank
Total Posts:  1215
Joined  2005-04-12

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!

Profile
 
 
Posted: 07 November 2013 11:37 AM   [ Ignore ]   [ # 96 ]
Member
Avatar
Rank
Total Posts:  248
Joined  2009-04-06
PhilW - 07 November 2013 04:53 AM

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.

 

 

Profile
 
 
Posted: 07 November 2013 12:30 PM   [ Ignore ]   [ # 97 ]
Power Member
RankRankRank
Total Posts:  1215
Joined  2005-04-12

Sounds like some great developments - exciting times!

Profile
 
 
Posted: 07 November 2013 12:43 PM   [ Ignore ]   [ # 98 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
PhilW - 06 November 2013 06:05 PM

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. grin

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!

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!

 

 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: 07 November 2013 12:48 PM   [ Ignore ]   [ # 99 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
Philemo - 07 November 2013 11:37 AM
PhilW - 07 November 2013 04:53 AM

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.

 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: 07 November 2013 01:09 PM   [ Ignore ]   [ # 100 ]
Power Member
RankRankRank
Total Posts:  1215
Joined  2005-04-12
FractalDimensia - 07 November 2013 12:43 PM
PhilW - 06 November 2013 06:05 PM

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. grin

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!

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.

Profile
 
 
Posted: 07 November 2013 02:05 PM   [ Ignore ]   [ # 101 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
PhilW - 07 November 2013 01:09 PM

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. wink

 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: 18 November 2013 04:59 PM   [ Ignore ]   [ # 102 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03

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/viewthread/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

 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: 09 December 2013 10:59 AM   [ Ignore ]   [ # 103 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
DUDU_00001 - 05 December 2013 10:29 AM

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.

I hope you find these answers helpful!

 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: 09 December 2013 11:18 AM   [ Ignore ]   [ # 104 ]
Active Member
Avatar
RankRank
Total Posts:  546
Joined  2011-07-03
DUDU_00001 - 05 December 2013 12:28 PM

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

See screenshots below for details.

Image Attachments
Reorientation_1.jpgReorientation_2.jpgReorientation_3.jpgReorientation_4.jpgReorientation_5.jpg
 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: 09 December 2013 11:38 AM   [ Ignore ]   [ # 105 ]
Active Member
RankRank
Total Posts:  965
Joined  2010-04-15

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!

 Signature 

          Site: http://bond3d.wix.com/carrarators
      Forum: http://www.bond3d.byethost18.com/
            My site: http://mhdproductions.be/

Profile
 
 
   
7 of 22
7