Build Modifier in the BGE

Hey,

Someone asked to make the “build” modifier work in the BGE.
Well, I thought I would try and make something silly this Saturday, so here it is:
https://drive.google.com/open?id=0B_vMzUtLDf7VQXRnZGo2bmhXZkE

The script can be used for multiple objects or so, just make sure to call “Build.start” in a Python controller in module mode, and use a little bit of nodes to get the vertex alpha value to work correctly.

Supported modes: build, decimate.

Nothing much serious really.

1 Like

Good job, man!
And can you make in the properties of the object another parameter - the direction (False, True)? To change - whether the object disappears, or appears.

Thank you for attention.

Ok, added !

Just add a build.mode string property, switch it to either build or decimate, and there you go !

You can also modify a bit the script so that you can add more modes.

  • Thank you man.

Very cool. Would it be possible to specify the pattern, eg from bottom to top?

if VList not in own:
    VList =[]
    for vert_index in range(obj.meshes[0].getVertexArrayLength(0)):
        VList.append(vert_index)
    own['VList']=VList
    owb['running'] =[]
else:
    popList =[]
    for vert_index in own['VList']:
        vert = obj.meshes[0].getVertex(0,vertex_index)
        if  obj.worldTransform*vert.xyz.z <own['floor']:
            own['running'].append(vert)

    pop2=[]
    index =[]
    for vert in own['running']:
        if vert.color[3] < .95:
            vert.color[3]+=.05
     else:
            pop2.append(index)

still missing a bit* will finish when I get a chance.

this uses nodes :smiley:

Attachments

teleport.blend (575 KB)

update file

Attachments

teleportFXblend.blend (574 KB)

Pretty cool BPR, but once you move your cube up or down the system falls apart :confused:

yeah swap to local position from object data node

Fixed it :smiley:

Attachments

Teleport_fx2.blend (642 KB)

That’s a bit more than just “switching to object local space” lol

Anyway, this effect is pretty damn cool ! But at this point you would better write your own GLSL material shader I think :stuck_out_tongue:
It would be easier to export, you could also get rid of animation key frames on the obj color (using uniform variables), and might even be compatible with vanilla BGE !

Either it doesn’t work on me, or I don’t know how to use it

it’s likely a bge / upbge thing

bge does not have the object color data node

Actually it has as far as I understood. I just animated the object color change and made it run in BGE. It did play the action.

Unless I misunderstood something

you don’t have access to object color node in the node editor though or the time node… making animation inconvenient as you have no uniforms to drive them

Then explain these:





And in case those didn’t clearify:
ColorBoxBGE.blend (419.1 KB)
(made in Blender 2.78c)

That is an animation, yes you can animate object color or change it with python.
Now open the node editor and try the same thing.

1 Like