PySwarm for PyCarrara (V0.6) Released 01/25/2013

168101112

Comments

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    0oseven said:
    Hi

    FD , Thankyou for all your hard work in making this facsinating plugin for carrara and the latest release.

    I didn't see mention of the terraine following ability in the new release or upcoming plans unless it goes by another name. It was hinted at some time ago so just wondering if you still plan to incorporate that. Forgive me if I overlooked it somewhere. Just getting to grips with V0.6.

    I had thought of a challenge in the CarraraTor forum but thought best to wait until most of your mods are done so we all play with the same tool.
    What do you think of that Dudu ?

    0oseven, you are very welcome and hope the tool comes in useful! TBH, developing this tool has been tremendous fun for me. Being a bit of a behavioral scientist, it allows me to practice my skills while simulating real life. :)

    Terrain following is scheduled for V0.7. This doesn't mean I'm not working on it. I already did some basic studies to see if my concept will work, and they were successful. Still some issues to work out however.

    So far I have based the order of feature implementation on what I think others might find important.

    So here is the current order of future MAJOR enhancements (I'm leaving out other improvements):
    1) Revised containment algorithm (V0.6.1)
    2) Basic motion animation (V0.6.2)
    3) Terrain following (V0.7)
    4) More motion animation (V0.7.1)
    5) Predator-Prey rule (V0.8)

    With that said, I am willing to consider shifting priorities based on user needs. "First come, first serve." If you have a need for a feature, and no one else is requesting something else, just let me know. I'll consider changing the order!

    If you're waiting for PySwarm to be "done" to set up a contest, you might be waiting a while. ;) The changes above will keep me occupied for a good two months at least. And it would be a good challenge for CarraraTor. I am always interested in seeing how others use PySwarm!

    Thanks for the feedback.

  • 0oseven0oseven Posts: 626
    edited December 1969

    Hi
    Regards development your program sound fine and so we know what to look forward to. I enquired about terraine because I had some tanks "flying" over the ground but no hurry - it was an experiment.

    Yes I guess no point in waiting for pyswarm final before laying down a challenge so Ive started a simple one with my own entry for starters ( I already had one prepared as they say)

    5th skill building exercise will be a simple pyswarm animation

    http://www.bond3d.byethost18.com/index.php?topic=61.msg336#msg336

  • DartanbeckDartanbeck Posts: 21,522
    edited December 1969

    TBH, developing this tool has been tremendous fun for me. Being a bit of a behavioral scientist, it allows me to practice my skills while simulating real life. :)

    Terrain following is scheduled for V0.7. This doesn't mean I'm not working on it. I already did some basic studies to see if my concept will work, and they were successful. Still some issues to work out however.

    So far I have based the order of feature implementation on what I think others might find important.

    So here is the current order of future MAJOR enhancements (I'm leaving out other improvements):
    1) Revised containment algorithm (V0.6.1)
    2) Basic motion animation (V0.6.2)
    3) Terrain following (V0.7)
    4) More motion animation (V0.7.1)
    5) Predator-Prey rule (V0.8)

    Man!
    I'm really glad that you're enjoying yourself. I sure am enjoying watching this thing grow from the sidelines. You just watch... one day I'll be boiding out some animations with it!

    Hey, thanks for all the hard work and quality assurance you've put into this. Fun is one thing, and I'm glad - very glad - that it is, because this is just awesome!

  • FractalDimensiaFractalDimensia Posts: 0
    edited January 2014

    Man!
    I'm really glad that you're enjoying yourself. I sure am enjoying watching this thing grow from the sidelines. You just watch... one day I'll be boiding out some animations with it!

    Hey, thanks for all the hard work and quality assurance you've put into this. Fun is one thing, and I'm glad - very glad - that it is, because this is just awesome!

    The past few weeks, I've been itching to get into my other interest - audio-driven animation. Unfortunately, I don't have time to do both of these, so it's a tough choice. I'll continue working PySwarm, but want to progress some on this other project, which I am lovingly calling "CRAAPy" (Carrara Rendered Audio Animation Python script). (Other acronyms I had in mind would not hav passed DAZ forum's language requirements. ;) )

    Yep.... Having too much fun.....

    Post edited by FractalDimensia on
  • DartanbeckDartanbeck Posts: 21,522
    edited December 1969

    That's awesome!
    The sound stuff you have done is really nice. Even if you might think it's a little CRAAPy! I think it's really nice kaleidoscope imagery! ;)

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    That's awesome!
    The sound stuff you have done is really nice. Even if you might think it's a little CRAAPy! I think it's really nice kaleidoscope imagery! ;)

    Thanks, Dartan.

    I'm working on a Carrara sequence that combines PySwarm with audio animation. Early concept tests look very good. Working on expanding the audio capabilities more, but still hope to unveil the final vid in a week or so. :)

  • FractalDimensiaFractalDimensia Posts: 0
    edited January 2014

    To help those who might be struggling with getting the PySwarm script to do what you want, I've added a new wiki page.

    Bizarre and Mysterious Manners (BAMMs)
    "Are your BOIDs doing some strange or weird behaviors and you don’t know what you’re going wrong with the parameter settings? This wiki page is designed to explain how PySwarm works (under the hood and mostly in layman’s terms) and then offer some suggestions on how you might be able to resolve these problems."

    http://pyswarm.wikia.com/wiki/Bizarre_and_Mysterious_Manners_(BAMMs)

    So far, I've identified 18 possible BAMMs that I offer some thoughts and suggestions about. I'll continue to update this page as I discover (for myself) other ones.

    Be sure to save the link to this page!

    Also, if you've got a BAMM in your BOIDs (like a bee in your bonnet) and a solution is not on this page, please either email me or post a comment in this thread!

    Thanks,
    FD

    Post edited by FractalDimensia on
  • DartanbeckDartanbeck Posts: 21,522
    edited December 1969

    I'm working on a Carrara sequence that combines PySwarm with audio animation. Early concept tests look very good. Working on expanding the audio capabilities more, but still hope to unveil the final vid in a week or so. :)
    If that doesn't get the ol' imagination pumpin'! Swarms of Boids whom respond to music... Or sound, in general... fascinating.
  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    If that doesn't get the ol' imagination pumpin'! Swarms of Boids whom respond to music... Or sound, in general... fascinating.

    Exactly, DB!

    I'm coming up with a lot of ideas already, some of which I am testing out in my first vid. Others that need to be explored.

    Some example ways that the two can be integrate right now (that I have thought of so far):

    1) Use audio to move an object in the scene that is a PySwarm attractor, causing BOIDs to move about as if "floating" with the music

    2) Use audio to resize an object in a scene that is a containment zone, forcing BOIDs to spread out and the squeeze in to the confinement space.

    3) Use audio to set the rotational speed of a grouped set of BOIDs. Increasing the volume (dB) drives the rotation faster, causing the BOIDs to spin about, while decreasing causes the rotation to slow.

    Some example ways to possibly integrate the two in the future (with modifications I am considering to PySwarm):

    1) Link a bulb's brightness setting to the Attractor's radius and/or strength. Then use audio to set a bulb's brightness. BOIDs would be more attracted to the bulb the brighter the light.

    2) Use audio as an additional PySwarm rule, which influences each BOID's speed and direction. With stereoscopy, BOIDs might swim one way when music is louder in the left channel, and the other way when louder in the right. This would produce something like "synchronized swimming" to match music or make it look like BOIDs are swarming to one side or other to follow the sound.

    3) Use audio to influence any of the PySwarm rule strength values. So, for example, loud low frequency music (a sudden boom) might cause BOIDs to be less synchronized by decreasing their alignment strength, or to move/fly apart by lowering or reversing their cohesion strength. Etc.

    The possibilities are unlimited....

  • 3drendero3drendero Posts: 2,024
    edited January 2014

    Made a short news post at CarraraCafe to spread the word, hope you like it:
    http://carraracafe.com/
    http://carraracafe.com/pyswarm-for-pycarrara-0-6-released-planned-new-fetures-revealed/

    Thanks for the new plugin!

    Post edited by 3drendero on
  • DUDUDUDU Posts: 1,945
    edited January 2014

    So far I have based the order of feature implementation on what I think others might find important.

    So here is the current order of future MAJOR enhancements (I'm leaving out other improvements):
    1) Revised containment algorithm (V0.6.1)
    2) Basic motion animation (V0.6.2)
    3) Terrain following (V0.7)
    4) More motion animation (V0.7.1)
    5) Predator-Prey rule (V0.8)

    With that said, I am willing to consider shifting priorities based on user needs. "First come, first serve." If you have a need for a feature, and no one else is requesting something else, just let me know. I'll consider changing the order!

    If you're waiting for PySwarm to be "done" to set up a contest, you might be waiting a while. ;) The changes above will keep me occupied for a good two months at least. And it would be a good challenge for CarraraTor. I am always interested in seeing how others use PySwarm!

    Thanks for the feedback.

    "Revised Containment Algorithm": does that want to say that one will be able to use any object as zone?

    Post edited by DUDU on
  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    3drendero said:
    Made a short news post at CarraraCafe to spread the word, hope you like it:
    http://carraracafe.com/
    http://carraracafe.com/pyswarm-for-pycarrara-0-6-released-planned-new-fetures-revealed/

    Thanks for the new plugin!

    Thank you, 3drendero, for the plug! :)

    It is right on spot (given my current plans).

    I will post comments on the news post there as things develop.

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    "Revised Containment Algorithm": does that want to say that one will be able to use any object as zone?

    The current version (V0.6) SHOULD handle any object as a zone.

    Using objects as a containment zone works fine in most cases. I say "SHOULD" because last night I found a bug in the containment code. If you are simultaneously moving AND resizing objects that are being used as containers, the BOIDs will not always stay in/out of the zones. I already have coded and tested a fix to this and will release the update this weekend.

    For an example of using objects in your scene as zones, see the included demo - "Containment Growth Test". You can study the parameters used by importing "Containment Growth Test.pyp" into PIA. Look at the Containment tab on how to use zone objects.

    The revised algorithm I am working on is in how PySwarm detects collisions - it will be more realistic by its ability to look further ahead and take actions BEFORE it encounters a zone boundary.

    I hope that helps.

  • DUDUDUDU Posts: 1,945
    edited December 1969

    I did not test yet V0.6 (too much work), but I look it this weekend… This new PIA is always compatible with the European symbols?

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    I did not test yet V0.6 (too much work), but I look it this weekend… This new PIA is always compatible with the European symbols?

    PIA 2.0 was built on top of PIA 1.1, which I modified to fix the symbols issue. Let me know if it does not work!

    FD

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    TBH, developing this tool has been tremendous fun for me. Being a bit of a behavioral scientist, it allows me to practice my skills while simulating real life. :)

    Terrain following is scheduled for V0.7. This doesn't mean I'm not working on it. I already did some basic studies to see if my concept will work, and they were successful. Still some issues to work out however.

    So far I have based the order of feature implementation on what I think others might find important.

    So here is the current order of future MAJOR enhancements (I'm leaving out other improvements):
    1) Revised containment algorithm (V0.6.1)
    2) Basic motion animation (V0.6.2)
    3) Terrain following (V0.7)
    4) More motion animation (V0.7.1)
    5) Predator-Prey rule (V0.8)

    Man!
    I'm really glad that you're enjoying yourself. I sure am enjoying watching this thing grow from the sidelines. You just watch... one day I'll be boiding out some animations with it!

    Hey, thanks for all the hard work and quality assurance you've put into this. Fun is one thing, and I'm glad - very glad - that it is, because this is just awesome!

    I'm sure we'll have to rib Garstor about this, as it sounds like something he was gushing about LW having and Carrara not having a couple months ago via correspondence . He was particularly pumped about herding and Predator Vs. Prey functions.

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    I'm sure we'll have to rib Garstor about this, as it sounds like something he was gushing about LW having and Carrara not having a couple months ago via correspondence . He was particularly pumped about herding and Predator Vs. Prey functions.

    EP, watching a video about what LW could do using this technology (okay, drooling might be more accurate) ... and THEN seeing even Blender has this built in ... is what got me going on this.

    We just need to figure out how to get PyCarrara ported to the Mac!

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    I'm sure we'll have to rib Garstor about this, as it sounds like something he was gushing about LW having and Carrara not having a couple months ago via correspondence . He was particularly pumped about herding and Predator Vs. Prey functions.

    EP, watching a video about what LW could do using this technology (okay, drooling might be more accurate) ... and THEN seeing even Blender has this built in ... is what got me going on this.

    We just need to figure out how to get PyCarrara ported to the Mac!

    If I could program and such, I would, but alas, I my programming days ended when my folks ditched the Trash80 (TSR80) for an Amiga.

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    If I could program and such, I would, but alas, I my programming days ended when my folks ditched the Trash80 (TSR80) for an Amiga.

    You must have started while still in diapers. ;)

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    If I could program and such, I would, but alas, I my programming days ended when my folks ditched the Trash80 (TSR80) for an Amiga.

    You must have started while still in diapers. ;)

    Not quite. :lol: '68 I started wearing diapers.

  • 0oseven0oseven Posts: 626
    edited February 2014

    Fractal - a QUESTION for you.

    Just needing a bit of clarification for when using a defined Carrara object for containment.

    In a video somewhere (not tutorial (no2) you demonstrated a setup using a cube placed in the scene such as the one in your default scene.
    You then referred to the cube parameters to get the dimensions which you added to the PIA for XYZ.

    I'm trying to spot or understand the difference between this and just using a zone with the XYZ defined ( no carrara object and box is selected)

    What difference does pySwarm see between these two setups ?

    I can see that the cube ( or object ) could limit the boid's height from ground.

    ie if box base was 100 feet above ground then boid could not move below that whereas I assume if just the XYZ was defined, the boid would be contained within those where if Z , for example, was 1000ft then zero feet would be ? where ? ground as defined by the grid ?

    Afterthought - I think I need to review the purpose of the PIA "Centre" settings as I'm not clear on exactly what effect these have.

    Hope you follow and I'm working a little bit from memory here so hope I got my facts right and apologies if not.

    Cheers

    Post edited by 0oseven on
  • FractalDimensiaFractalDimensia Posts: 0
    edited February 2014

    0oseven said:
    Fractal - a QUESTION for you.

    Just needing a bit of clarification for when using a defined Carrara object for containment.

    In a video somewhere (not tutorial (no2) you demonstrated a setup using a cube placed in the scene such as the one in your default scene.
    You then referred to the cube parameters to get the dimensions which you added to the PIA for XYZ.

    I'm trying to spot or understand the difference between this and just using a zone with the XYZ defined ( no carrara object and box is selected)

    What difference does pySwarm see between these two setups ?

    I can see that the cube ( or object ) could limit the boid's height from ground.

    ie if box base was 100 feet above ground then boid could not move below that whereas I assume if just the XYZ was defined, the boid would be contained within those where if Z , for example, was 1000ft then zero feet would be ? where ? ground as defined by the grid ?

    Afterthought - I think I need to review the purpose of the PIA "Centre" settings as I'm not clear on exactly what effect these have.

    Hope you follow and I'm working a little bit from memory here so hope I got my facts right and apologies if not.

    Cheers

    0oseven, very good question. My wiki pages are a bit behind my feature development, so after reading your question, I realize I need to work on this some more.

    As I understand, the question is - How is using a Carrara object to define a containment zone different from one defined with PIA?

    Let me mention here that Carrara-based zones work the same as ones you define in PIA. The differences are really about convenience of use and zone movement:
    1. The calculations for defining a Carrara-based zone are simpler, as PySwarm will handle zone position (center) for you.
    2. You can move Carrara-based zones around in your scene. PIA based zones cannot be moved.
    3. You can resize Carrara-based zones. You cannot resize PIA-based zones.

    Movement and resizing works both at the start of the animation and during animation. For example, suppose I create a zone, and after I generate and import my script, I decide I want to change the zone's center or size. If I am using a Carrara-based zone, I just have to move it to the new starting place and re-import the script. If the zone is "hard coded" in PIA, I would have to go back into PIA, edit the containment parameters, and re-generate the script.

    However, I left the ability to set zones in PIA because sometimes you may not want to clutter your CAR scene with objects that are used only to set zones that don't move.

    A few more notes on this topic -

    First, the calculations for creating Carrara zones would have been even easier, but unfortunately PyCarrara does not provide me access to an object's size, only scaling values! So PySwarm can detect when an object changes scale, but cannot determine it's size. This is why you still have to enter size values for Carrara-based zones. I hope to have time to modify PyCarrara in the near future to add this feature. If/when so, you'll only need to point PySwarm at a Carrara object and it will do the rest!

    Second (this is important), if you are resizing an object you are using as a zone, be sure you resize the OVERALL scaling value, and NOT the individual XYZ scalings. I plan to change this in a future release, but for now, PySwarm only checks the OVERALL scaling value!

    And third, PySwarm uses the hot point to set the center of a Carrara-defined zone, so be sure to click the "HP->Obj" button to center the hot point (unless you are doing some special effects changes).

    The "hot link" page on Containment might provide some insights, as it contains some figures showing how center, height, radius, etc. are used to define zones. You will note that I changed the definition of box zones with V0.5 to match using Carrara objects - you no longer define the "base" of the box, but it's center (centre).
    http://pyswarm.wikia.com/wiki/PIA_(V2)_Containment_Rule#Zone_Parameters

    Remember you can get to this page at any time from PIA by displaying the Containment tab and clicking "Online Help"

    Finally, if you haven't done so yet, I suggest looking at the sample "Containment Growth Test" CAR and PYP files to see how to set up moving/resizing Carrara objects for zones.

    Post edited by FractalDimensia on
  • 0oseven0oseven Posts: 626
    edited December 1969

    Thanks -that has clarified the matter considerably.
    I have quickly looked at most working files but not the 'containment growth test' -which I will do.

    The wiki link did not connect where I think you wanted it.
    Back to playing !
    cheers and thank you for quick response

  • FractalDimensiaFractalDimensia Posts: 0
    edited February 2014

    A brief update on the status of the containment algorithm revision. I've not had the time I wanted to devote these last two weeks on this (my son had his Eagle Scout ceremony last Saturday; YAY!), so progress is slower than I had hoped.

    However, I've been able to settle on an algorithm that nearly eliminates container collisions (when a BOID flies through a container wall). My current test scenario dropped collisions from 1872 down to 2 (99.9% reduction).

    I still need to make some tweaks to the algorithm and run further tests, so it will likely be next weekend before it is ready for release.

    V0.6_.1_revision_status_.jpg
    532 x 605 - 73K
    Post edited by FractalDimensia on
  • 0oseven0oseven Posts: 626
    edited December 1969

    Good to hear of forthcoming updateFD because I have had much trouble keeping boids within a carrara object or other containment zone.
    Congrats to FD Junior !!

  • FractalDimensiaFractalDimensia Posts: 0
    edited February 2014

    0oseven said:
    Good to hear of forthcoming updateFD because I have had much trouble keeping boids within a carrara object or other containment zone.

    My original thinking for containment was much "softer" than my view of it now. It was more meant initially to be a general way to bound where BOIDs move. When you want to create more rigid boundaries, like physical walls, that can be a problem.

    There are 2 things you can do to help this:

    1) Increase the zone's strength setting. By default, the value is 1.0. You might try values of 3.0-4.0, for example. This will cause BOIDs to move more quickly back into/out of the safe/restricted zone boundary.

    2) Change the size of the boundaries. In general, I found setting a safe boundary zone to be about 90% of the actually limits works well. For example, if you wanted to keep BOIDs within a boxed region with dimensions 5 feet wide x 5 feet deep x 5 feet tall, center the Carrara zone object (cube) at the center of the region you want them contained within, and set the dimensions to be 4.5 feet x 4.5 feet x 4.5 feet (since 90% of 5 feet is 4.5 feet).

    In the Angelfish demo/example, you will note that the cylinder I used to keep the fish from swimming through the lighthouse was slightly larger than the lighthouse.

    For this second option, you will need to make the actual zone objects smaller the faster BOIDs move. For example, you may need to shrink the zone object to as little as 50% of your region for really fast BOIDs.

    Congrats to FD Junior !!


    Thanks. He worked hard to get his project done, and got it in just under the wire (before his 18th birthday). It would have been unfortunate to not get it done on time. =/
    Post edited by FractalDimensia on
  • dot_batdot_bat Posts: 373
    edited December 1969

    is there a mac version. this looks great

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    dot_bat said:
    is there a mac version. this looks great

    I wish there was. :-S

    Unfortunately, Frederick Rible (the person who developed the PyCarrara plug-in, which is needed for PySwarm) only developed a PC version. The source code is available, so we just need to find a hearty soul who's willing to port it to the Mac. Once that is done, I am willing to start working a Mac version of PIA.

    FD

  • 0oseven0oseven Posts: 626
    edited December 1969

    QUOTE For this second option, you will need to make the actual zone objects smaller the faster BOIDs move. For example, you may need to shrink the zone object to as little as 50% of your region for really fast BOIDs. ENDQuote

    I have read most of your BAM on zones so tried quite a few things but haven't hit on the right combination - yet !

    I think maybe I was shrinking the "Region" rather than the "Carrara Object" ( the region being the typed in parameters - yes? ) which is I believe how the adjustment is described in your BAM.I'll try it how you describe above also observing speed.

    Question - If an " animation group" is created for the boid can/does that effect the way pyswarm handles files- Scripts seem to generate ok but I wondered if it could cause problems when script was run in Carrara.

    cheers

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    0oseven said:
    I think maybe I was shrinking the "Region" rather than the "Carrara Object" ( the region being the typed in parameters - yes? ) which is I believe how the adjustment is described in your BAM.I'll try it how you describe above also observing speed.

    Question - If an " animation group" is created for the boid can/does that effect the way pyswarm handles files- Scripts seem to generate ok but I wondered if it could cause problems when script was run in Carrara.

    cheers

    Once I have completed this next release, I will do a short tutorial focusing on Containers/zones.

    Regarding your question, it is possible to put all of your BOIDs into a group and the PySwarm script will work fine with this.

    In PIA, you will need to refer to the complete base name for PySwarm to find the objects. For example, if you have 20 BOIDs in your Carrara scene named "Fish", and you grouped them all under the name "School", in PIA, for BOID Name, you would use:

    "School/Fish"

    Use the "/" symbol to separate the group names. (Thus, there is really no limit to the level of groups you can embed your BOIDs withiin.)

    Grouping BOIDs allows you to do some interesting effects and handle some situations that might otherwise be a problem. For example, suppose you want to manipulate a number of BOIDs (say fish in a fishbowl) that are also on a moving train. You should be able to group the fish (e.g., in a "fishbowl"), and then place the bowl in a large group called "boxcar." Moving and rotating the boxcar should not affect the fish animation, which is done relative to the fishbowl. (To be honest, I have not had time to fully test this out, so I should say this is hypothetical at this time.)

    I am working on a scene where I have placed a number of BOIDs in a group, and after animating them with a PySwarm script, I am also animating the group by moving and rotating it, which causes the BOIDs to move and rotate accordingly.

    FD

Sign In or Register to comment.