Thursday, December 29, 2016

Particle Structure Addon for Blender 3D

I AM SO EXCITED TO SHARE THIS!!!!

 - Said me about a year ago.

This is a standalone Blender addon that takes whatever meshes or objects you have selected, and fills them with particles of like-shaped objects or meshes.




Before

AFTER!!!


All you do to use the addon is hit space to open the search tool, then type:

  Add Particle Structure

Or you can just go to;

  Add > Add Particle Structure

And that's it!!






- Download Here -

Tuesday, September 27, 2016

Procedurally Playful Facebook Page is Operational!

I have a new "like" page on Facebook:

Link - Procedurally Playful

On a side note, I also have 3 new tools in the works. One is a fun little script, the other is a full blown Blender Addon, and the THIRD, well... the third is something I think every procedural generation enthusiast, game developer, environment developer, machine learning enthusiast, and 3D developer and/or animator should be excited about.

You'll see. ;)

As for that, here's a few pics of one of the tools I made doing what it does best:






Thursday, September 15, 2016

Procedural Biome Generator - Update (Plus Download Link)

I've finished the first draft of my biome generator! (Without foliage thus far.)

Part of the work need to be completed was the ground color generator and a lot of math behind the temperature vs. rainfall biome selector. All of these things are finished, the first draft is ready for recreational release, and I will now move on to the foliage generation. This will be released in V2 of the Biome Generator.

If look closely you can see the ground color change slightly from dark to bright. These are two forest based biomes.

As you can see, there's a bit of variety in color added to create slightly more complex (Yet low polygon) groundscape. The shrubbery will be added in version 2.


The generator works by taking any selected landscape, and starting from the top descending to the bottom, it begins to assign a biome to each individual face. This generator works via individual faces instead of a more complex blending algorithm simply because this is a proof-of-concept tool, AND a cool excuse to make low-poly artwork.

Just remember this is version 1, and there's a lot I could clean up, but for now, I'm just trying to get this out there, and I'll try to clean my code up around V.3.

You can use it by doing the following:


Copy/Paste the following code into Blender 3D's Python Interpreter:


def create_biome(temp1,temp2,rain1=40,rain2=40): #Rainfall is default 40 cm. temp in C.
    land = bpy.context.object
    temperature_range = abs(temp1-temp2)
    rainfall_range = abs(rain1-rain2)
    height = land.dimensions.z
    material0 = bpy.data.materials.new(name='Cold Red Grass')
    material0.diffuse_color = (0.67, 0.14, 0.07)
    land.data.materials.append(material0)
    material1 = bpy.data.materials.new(name='Rocks and Gravel')
    material1.diffuse_color = (0.52, 0.43, 0.22)
    land.data.materials.append(material1)
    material2 = bpy.data.materials.new(name='Desert Shrub')
    material2.diffuse_color = (0.18, 0.34, 0.22)
    land.data.materials.append(material2)
    material3 = bpy.data.materials.new(name='Dead Grass')
    material3.diffuse_color = (0.53, 0.26, 0.16)
    land.data.materials.append(material3)
    material4 = bpy.data.materials.new(name='Rocks/Leaves/Sticks')
    material4.diffuse_color = (0.51, 0.28, 0.14)
    land.data.materials.append(material4)
    material5 = bpy.data.materials.new(name='Light Foliage/Moss')
    material5.diffuse_color = (0.13, 0.38, 0.03)
    land.data.materials.append(material5)
    material6 = bpy.data.materials.new(name='Desert Sand')
    material6.diffuse_color = (1, 0.37, 0.13)
    land.data.materials.append(material6)
    material7 = bpy.data.materials.new(name='Dense Grass/Shrub')
    material7.diffuse_color = (0.16, 0.48, 0.02)
    land.data.materials.append(material7)
    material8 = bpy.data.materials.new(name='Dense Shrub')
    material8.diffuse_color = (0.03, 0.30, 0)
    land.data.materials.append(material8)
    material9 = bpy.data.materials.new(name='Charred Earth')
    material9.diffuse_color = (0.49, 0.15, 0.07)
    land.data.materials.append(material9)
    materialsnow = bpy.data.materials.new(name='Snow')
    materialsnow.diffuse_color = (1.0, 1.0, 1.0)
    land.data.materials.append(materialsnow)
    for x in land.data.polygons:    #Begins to assign materials to polygons from top to bottom.
        m = x.center.z + (height / 2) + 0.01 #math modifiers to find temperature at point.
        j = height / m
        if temp1 >= temp2:
            temp_proxy = (temperature_range / j) + min(temp1,temp2) #determines temperature at specified height.
        elif temp1 < temp2:    #GET THIS WORKING HERE.
            temp_proxy = temperature_range - (temperature_range / j) + min(temp1,temp2)
            #temp_proxy = (temperature_range / j) + min(temp1,temp2) #determines temperature at
        if rain1 >= rain2:
            rainfall = (rainfall_range / j) + min(rain1,rain2)
        if rain1 < rain2:
            rainfall = rainfall_range - (rainfall_range / j) + min(rain1,rain2)
        graphline = 165+(temp_proxy*10) #This is to cut the diagonal line on the biome graph.
        if rainfall > graphline:    #This corrects any rainfall above what is actually realistic.
            rainfall == graphline-1
        """ -------------------Begin material assignment-------------- """
        if temp_proxy < -5: # and (temp_proxy > graphline): #Tundra
            sl = 15 * abs(temp_proxy + 5)
            snow = ranyn(sl)        #This math causes more snow for lower temperature.
            if snow == 1:
                x.material_index = 10
            elif snow == 0:
                x.material_index = choice([0,1])    #Assign proper Biome Color to polygon
        if (temp_proxy >= -5) and (temp_proxy < 3) and (rainfall >= 30): #taiga.
            x.material_index = choice([1,7,7,7])
            plant(x,1,'Pine')  """ THIS IS A TEST """
        if (temp_proxy >= -5) and (temp_proxy < 13) and (rainfall < 30): #Desert and Grassland
            x.material_index = choice([1,2,3])
        if (temp_proxy >= 3) and (temp_proxy < 20) and (rainfall >= 30) and (rainfall < 85): #Woodland/Shrubland
            x.material_index = choice([7,3])
        if (temp_proxy >= 3) and (temp_proxy < 20) and (rainfall >= 85): #Temperate Deciduous Forest
            x.material_index = choice([7,4])
        if (temp_proxy >= 3) and (temp_proxy < 20) and (rainfall >= 215) and (rainfall < 215): #Temperate Rain Forest
            x.material_index = choice([4,5,5])
        if (temp_proxy >= 13) and (temp_proxy < 28) and (rainfall < 30): #Subtropical Desert
            x.material_index = choice([6,6,6,2])
        if (temp_proxy >= 20) and (temp_proxy < 28) and (rainfall >= 30) and (rainfall < 265): #Tropical Seasonal Forest
            x.material_index = choice([7,7,4])
        if (temp_proxy >= 20) and (temp_proxy < 28) and (rainfall >= 265): #Tropical Rain Forest
            x.material_index = choice([8,8,8,4])
        if temp_proxy >= 28: #Mars.
            x.material_index = choice([1,9])


Once you've done that, you can use the tool by selecting the landscape you want biome-ified and calling the following function: (Just copy paste this into your interpreter if you don't understand what I'm talking about.)

create_biome(-15,10,40,60)
 
The function works using the following parameters:

create_biome(
    Starting_Temperature, 
    Ending_Temperature, 
    Starting_Rainfall,
    Ending_Rainfall
    )

#Temperature in celcius and Rainfall in centimeters. 

You can use the following chart as a sort of cheat sheet:

Enjoy the first draft! Feel free to modify or make it your own! (This version anyway!)

Click the link below for download link: 
  
Download Here