Meta ball wire size > 1 ?

I’ve written a meta mesh script to generate meta balls from beveled bezier curves, but I’m having some issues with the wire size of the meta balls. The main problem is that alla the curves are quite large with radius of approx < 50 units or so. This makes even the max wire size (1) quite small, so the actual computing of the meta mesh takes forever (generating the meta balls only takes a couple of seconds for 100+ curves).

So, my question is: Is it possible to force a greater wire size from python?

I read here somewhere that the meta part of Blender is quite out-dated and needs some polishing, maybe something like variable wiresize could give us the edge to other packages in the area?

Regards,

swebal

Try this:

Create small metaballs, and scale the object itself up.

Not sure what’ll happen in python, but just try it in the 3d view if you scale the object up it doesn’t increase the resolution.

Hope this helps

That might actually work, scaling the first meta ball in object mode (edit mode seems to increase the resolution). Scaling the second meta ball also does not affect the resolution. Good idea!

Worked like a charm! This actually gives me great control, as I can set a size/scale ratio when creating the meta balls, so building a preview can be done quicker! Thanks!

No worries :). what you ask for would be nice as a feature though, not sure how many would use it.

You mean the meta beziers? It is kinda cool actually, I use them to create meshes from vascular systems (arteries / veins) segmented from MR imagery. It works like Clay Studio for 3dsMax.

Oh, no I think your idea sounds really useful, I meant larger wiresizes as a feature :slight_smile:

Let us all know when the scripts ready!

Well the script was “ready” when I posted the previous message, below is the function that creates the meta ball:



def newMetaBall(loc, radius, gridsize, sratio):
    # Get current scene in Blender
    sce = Blender.Scene.GetCurrent()
    # Create a new meta ball
    mball = Blender.Object.New('Mball', 'metaball')
    meta = Metaball.New()
    mball.link(meta)
    # Set the wire size of the meta ball
    meta.wiresize = gridsize
    # Set update method to fast
    meta.update = 2
    # Add elements to meta ball
    mb = meta.elements.add()
    mb.radius = 1.6 * (radius / sratio)
    # Add the meta ball to the scene
    mb = sce.objects.new(meta, 'meta')
    mb.setLocation(loc)
    mb.size = (float(sratio), float(sratio), float(sratio))


Regards,

swebal