So Bassam’s been away in Bulgaria for a couple of weeks and Henri and I mostly had the studio to ourselves.  I’ve been working on a mushroom generator for a couple of timelapses – not that tube will be filled with glowing mushrooms, more that we wanted something half way between the ivy generator and a fully fledged particle system.  Henri modeled some funky mushrooms and together we spun together a quick demo video just to show off some of the effects that are possible, and to exercise our fetish for indirect lighting and luminous pink.

Mushroom Generator Blender 2.5 from Henri Hebeisen and Josh Wedlake on Vimeo.

The script is still heavily in development but if you like alpha stuff and you’re happy to do your own debugging, then feel free to download and run.

UPDATE: Find the latest build here.
UPDATE: release 4 is fixed for r31856 [Fri Sep 10 16:54:53 CEST 2010]… don’t expect it to last long though!

Essentially you need to model a couple of mushrooms (just a generic term – you can model flowers or trees or robotic arms) with some shapes for their animation which will be blended sequentially, some shapes for random variation, some shapes in which they bend up the y axis, a painted vertex group for shrinkwrapping the base of the mushroom, all scaling and rotation applied and the origin at the base of the mesh.

above: creating the shapes for auto animation

above: adding manual animation to a mushroom

You also need a target mesh which has nice topo (ideally no elongated tris or nasty convex quads), optionally painted vertex groups named OBmymushroomname… and MAmymushroommaterial… to control the distribution of your various materials and different object types, optionally a limit vertex group (ie only faces within this will receive mushrooms), and a lot of patience.  Select the mushrooms then make the target active and tab into edit mode, select the start face(s) then hit spacebar>Mushroomer (remembered to run the script first).

above: mission control, godspeed

Adjust the settings and hit go.  I suggest you run blender from the terminal so you can watch for progress and any hangups.  You might well want to abort if it starts slowing right down from too many mushrooms.

above: when its done

Development on this script has been a bit of a nightmare.  Currently it is not possible to create multiple linked objects and have different shape key and material animation blocks on them without having to duplicate the mesh and/or material blocks (thus unnecessarily eating up huge amount of memory and removing the possibility to edit the mesh for one mushroom and have all of the update).  This is in the blender bug tracker as #23546 and #23547.  If they get fixed you can uncomment the deep data path keyframe adding and enable all the code for migrating actions to object level.  Another limitation which slowed development is that it is currently not possible to merge two actions into one.  This is necessary if you are moving mesh level and material level animation data back to object level.  Essentially you need to combine two actions into one.  Not only is this not possible, but its also not possible to copy an fcurve in its entirity, but rather python has to iterate through very slowly copying every handle one by one, and even this is susceptible to some bugs (not yet reported).  This is because the collection of fcurves is read only even though each fcurve itself if read/write.  I was also held up by bug #23532 which prevented me from doing the action block combining in the NLA editor, and for a short while by bug #23548 which caused blender to crash when creating new fcurves.  Finally the script can’t currently support animation data on the mushrooms’ materials due to bugs #23593 and #23594 [UPDATE Campbell fixed these, great news! Material & texture animations are now supported!] – I’ve chosen to block this feature rather than risk an inescapable hang and data loss – uncomment those lines at your own risk!  Fingers crossed the devs will iron these out sooner or later and the mushroom generator will be running faster, with lower memory requirements, smaller file sizes and more stability!

Its also been a sad day today as we waved goodbye to Henri who is on his way back to France as I write.  Its been great fun working together for the last 2 months.  Luckily we’ll only be a stones throw apart when we’re back at our separate homes in Toulouse and London.  If all goes well we’ll be at the Blender conference this October as well.  Rest assured, the world hasn’t seen the end of the glowing mushrooms saga – I’m hope we’ll have another chance to work together soon!

  1. Boris :

    Nice animation despite the limitations you’ve mentionned – and mastered – and nice shading as well. Plus, a tip of the hat to the Pink Floyd… (sacré Riton, va). I really like it.

    Josh, I hope this next sentence will soften your ‘sorrow’ : Henri’s return to Toulouse is great news here!

  2. Raphael_Kox :

    Awesome work man!
    Very nice mushrooms (mabye Mario pays you a visit)

    Also, when i saw the “prism”, I smiled almost involuntarily.

    As a whole: Great.

  3. tkroo :

    excellent results!

  4. josh :

    the prism was henri’s work! it was a great last minute idea which we rushed through the renderer before he left for france. i think having pink floyd on in the studio every day was getting to him!

  5. thunk :

    Great work, Josh! Really nice effect.

    Having a bit of trouble getting the script to run, though (knowing me, I probably missed a vital step somewhere! 🙂 ). Pasted the script into v2.53 of Blender, modelled a few objects & a target mesh, selected all (target mesh last), entered edit mode, selected a face, hit ‘Run Script’ in the text editor, mouse over 3D view, hit spacebar and tried to type Mushroomer but no joy (it wasn’t to be found in the spacebar search results).

    Would it be possible for you to maybe upload a simple blend file with whatever is needed (just simple cubes or similar for the objects) so we have everything needed in one blend to get the script working? If you have time, maybe a quick vid tutorial would help make the steps clear too… but only if you have time! 🙂

    Many thanks.

  6. baali :

    Nice work 🙂

  7. josh :

    heya, the python API changed literally just after we published the script! you need to change line #957 to read
    wm = context.window_manager
    instead of
    wm = context.manager
    Also make sure all of the dropdown boxes have something selected – a current bug in blender i think.
    I’ll try and get an update and example file up tonight, I’m also currently working on documentation over at http://wiki.tube.freefac.org/wiki/Mushroomer – its a work in progress!

  8. thunk :

    Josh, big thanks for putting together a wiki and blend file!! 🙂

    Still can’t quite get it to work, though. Here are the steps I took:
    – Downloaded r31726 of Blender from GraphicAll (Win32 compile by COG).
    – Downloaded mushroom_test_release2.blend from wiki.
    – Opened blend in r31726 of Blender and hit ‘Run Script’.
    – Selected all 3 mushroom objects and, lastly, target mesh.
    – Entered edit mode to see several faces already selected.
    – Hit spacebar, typed ‘mushroomer’ and selected it.
    – Mushroomer pop-up menu appeared. Kept all default options and hit ‘OK’.

    This results in the following error in the console window:
    Traceback (most recent call last):
    File “C:\Blender\Blends\mushroom_test_release2.blend/mushroom.py”, line 1019, in execute
    File “C:\Blender\Blends\mushroom_test_release2.blend/mushroom.py”, line 866, in generate_mushrooms_shapes_database
    KeyError: ‘s’

    Did I miss a step somewhere? Thanks, Josh.

  9. josh :

    hi thunk,
    the error your getting is because the different original mushrooms do not have shape keys set up in a way that they can be used together. If you look at the drop down boxes in the ‘Shape Key Settings’ section of the Mushroomer GUI you will see that they are lists of sets of shapes.

    for example if your mushroom has shapes:
    s1,s2,s3,a1,a2,bend1,bend2,random1,random3…
    then the list of valid prefixes will be
    s…, a…, bend…, random…
    There is also an option called ‘Don’t Use’ which means the script won’t try to insert keys on any of these shapes.

    The problem is at the moment the script doesn’t catch your error if you select a prefix from the dropdown which doesn’t exist on all of the mushrooms. The reason you are getting an error is because you are trying to use a set of shape keys which doesn’t exist on all of the original mushrooms (I suspect you have left the lifecycle settings on ‘s…’ rather than use existing animation). The demo mushrooms are not intended to be used together, rather they show 3 different and incompatible ways of creating shape keys!

    Try selecting just one of the mushrooms. Have a look at the list of shapes in the blender properties panel. See if they seem to be compatible with the naming conventions for shapes (in the wiki documentation). Is the mushroom already animated or does it just have a list of sequential shapes? run the script with as you did before but only with this one mushroom. Take a close look at the settings in the dropdown boxes – getting these wrong causes the error. Click OK and fingers crossed.

    I’m going to have a look and see if I can make the script more user friendly in this regard! thanks for the feedback and let me know how it goes!

  10. josh :

    hey thunk I’ve now updated the script (link on the wiki) which should make it a bit clearer in the UI why you get that error. I’ve also added a bit more documentation to the wiki to explain how those shape key drop down boxes in the UI work – setting the right value there is pretty essential to the script! I’ve also put up a new demo file (again link on the wiki) with more explanatory text.

    Try just selecting one of the mushrooms (there are 3 mutually incompatible ‘types’ provided in the new example blend) then selecting the target etc and running as before. Take a close look at what the drop downs say before you OK it and make sure you choose the right options for what you want.

    Hopefully I’ve made the script a bit more user friendly thanks to your feedback! J

  11. thunk :

    Many thanks Josh. Thought I was going to have to go back to you again with pleading eyes to ask for some more guidance but, after a bit of time tinkering, there they were – 2 grey mushrooms on the mound! 🙂 (think it was either me setting an option incorrectly or just the luck of the draw that no mushrooms appeared that first time)

    Have since got plenty of red and blue mushrooms on the go as well, animating away.

    Haven’t spent enough time playing with it yet but, at the moment, would maybe suggest outputting some more status messages to the console window – a ‘Finished Generating’ message when complete (wasn’t entirely sure if it had finished when it had) and also state the number of mushrooms/items generated at the end.

    Thanks again for sharing and writing up all that documentation, Josh. I’m sure there will be plenty of fun & interesting things to do with Mushroomer!

  12. josh :

    great news! I was beginning to wonder if I’d managed to write a script that was so unintelligible that only I could use it! Typing up the documentation was a bit of a shock to see just how many options I’d built in since the very first in-house demo (which simply selected a forked pattern of faces on a mesh without any user options at all). We’re hoping to expand functionality in the future to include objects with armatures as well as shape keys.

    Hopefully when I get a moment I’ll add in some more status text in the console. As we’re running linux and MacOS in the studio most of us don’t get console windows unless we specifically start blender from a console. I was hoping that there would be some way of outputting to blender’s status bar (as in 2.4x scripts) or the internal console report windows but that doesn’t seem to have materialised yet. I finish my internship next week and I have a load of modeling to get done before I go so that change might have to wait until I get back to England.

    For our current setup in the studio we use blend library files which contain groups of objects which we then link in (as instanced groups) to the scene files. I’ve got a lot of work ahead of me to get the script working on proxy armatures and instanced groups and to keep it intelligable!

  13. […] This is a Blender 2.5 mushroom generator script developed by Josh Wedlake for the Tube Project. The Mushroomer Script will  distribute original mushroom object over other object’s surface and the result can […]

  14. Beautiful. Super impressive.

©URCHIN 2015