New around here? Register your SA Forums Account here!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $10! We charge money because it costs us money per month for bills alone, and since we don't believe in shady internet advertising, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Chance
Apr 28, 2002

Have a copy of the solid object on another render layer and at the moment of impact swap its visibility for the shattering one? I don't know Max but that's how I would do something like that in blender.

Chance fucked around with this message at 21:50 on Feb 10, 2014

Adbot
ADBOT LOVES YOU

Chance
Apr 28, 2002

Wow just looked at that again after last night, silly mistake. Blender is a weird beast, kind of a pain to learn coming from other stuff, but on the flipside has a lot of free learning material out there. I don't know if I would necessarily choose it over another but it can be neat.

Chance
Apr 28, 2002

Warbird posted:

Does anyone have a resource for best practices for doing physics shenanigans in blender? I'm trying to replicate a gif I saw on reddit some time back of a pit of colored balls being stirred and naturally the ten thousand or so spheres I'm accounting for is a touch taxing on my system. Is there a smarter way to be doing this than having umpteen gajillion rigid-bodies going to town? My gut is saying that a particle system or potentially some fluid simulation might be a better way to go.

You are probably looking for this:
https://blender-addons.org/molecular-script-addon/

I haven't played with it since it was ported to 2.8, but it previously was pretty easy to setup rigid body particle systems that self collide using it.
That page has a link but this compilation video better shows what the addon can do (example ball stirring around 11 min mark):
https://www.youtube.com/watch?v=d-8bLbL3sXQ

Chance fucked around with this message at 09:53 on Dec 31, 2019

Chance
Apr 28, 2002

For hard surface blender stuff check master xeon he went on to make the hardops plugin and had a lot of sculpt tutorials before.

Chance
Apr 28, 2002

I don't quite understand from the picture what implied motion is being blurred. Is it a hand coming down to grip the chair arm? A 2d doodle of it might help.

Two cheap hacks I can think of in blender.

1 Use proportional editing with smooth falloff and the connected setting. Grab a single vertex and rotate it on the axis the motion is in, mouse wheel to change the falloff range. You might need to pose the hand a bit opened up and then do this to rotate it Into place. It will stretch the geo and falloff at the end. You might need to mask and do individual fingers or such.

2 Put a simple armature in the hand, only weight paint the geo on the palm side, rotate it closed. Blur the weight painting to attain better smoothness in it stretching out.

Is that too simple?

Edit: to say I meant this if you wanted a single solid stretching smear, not multiples. Though I guess you could just repeat it a bunch.

Chance fucked around with this message at 04:19 on Oct 30, 2024

Chance
Apr 28, 2002

Bad Munki posted:

It was suggested I ask my question here, maybe y’all can help an absolute novice:

If it's just one object you can just go to edit mode, pick a vertex, cursor to active, then tab back to object mode and origin to cursor.

If you definitely want to use the bounding box uh you should be able to do that in python, getting the object position, bounds and then again setting 3d cursor to that spot and setting the origin to the cursor.

Or silly way, in edit mode just select all and then move it to offset from the current origin.

If that doesn't make sense I can check later what the actual python commands would be.

Chance
Apr 28, 2002

Bad Munki posted:

e: Oh this Python option could be great, I could gin up a script to align these things automatically for any new ones I have to do (there will be a bunch) and do the intersection and export the cleaned up geometry all in one step.

If you're just looking for the minimum in all 3 axis, here is a python script from chatgpt that appears to work in my testing, which is better than what it usually gives me.

code:
import bpy
import mathutils

def set_origin_to_min_world_bbox(obj):
    if obj.type != 'MESH':
        print(f"{obj.name} is not a mesh object.")
        return

    # Get world-space bounding box corners
    local_bbox_corners = [mathutils.Vector(corner) for corner in obj.bound_box]
    world_bbox_corners = [obj.matrix_world @ corner for corner in local_bbox_corners]

    # Find the minimum X, Y, Z position in world space
    min_corner = mathutils.Vector((
        min(corner.x for corner in world_bbox_corners),
        min(corner.y for corner in world_bbox_corners),
        min(corner.z for corner in world_bbox_corners),
    ))

    # Create a temporary empty at that location
    bpy.ops.object.empty_add(type='PLAIN_AXES', location=min_corner)
    empty = bpy.context.active_object

    # Select only the target object
    bpy.ops.object.select_all(action='DESELECT')
    obj.select_set(True)
    bpy.context.view_layer.objects.active = obj

    # Set origin to empty (i.e., to min_corner)
    bpy.ops.object.origin_set(type='ORIGIN_CURSOR', center='MEDIAN')
    bpy.context.scene.cursor.location = min_corner
    bpy.ops.object.origin_set(type='ORIGIN_CURSOR')

    # Delete the temporary empty
    bpy.data.objects.remove(empty, do_unlink=True)

    print(f"Set origin of {obj.name} to minimum bounding box corner at {min_corner}")

# Example usage
obj = bpy.context.active_object
if obj:
    set_origin_to_min_world_bbox(obj)
else:
    print("No active object selected.")

Adbot
ADBOT LOVES YOU

Chance
Apr 28, 2002

Yeah I didn't even read it beyond pressing run to see if it worked. Didn't notice it setting cursor by location anyways.

The last time I asked it to do a similar operation it would set the origin to the position and then move the whole object, so it just kept nudging over in place repeatedly.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply