Mesh Parts are live!

Still waiting for the ability to make CSGs into mesh ids as well…

1 Like

Why? When you copy a CSG part, it will use the same resource already. (Not like you have to load the same thing twice)

Does it? I noticed that a lot of the same unions in a place will load gradually, as if different assets are loading.

If you copy them they are the same asset. If you separate them and re-union them, they’re different from that point on, even though they’re technically the same structure.

I want to take the polygons from a CSG and put them into a MeshId for a smaller part and have the mesh scale a lot bigger.
The only way to do something similar is just have the CSG part welded on and non-collideable.

I wouldn’t mind if parts below 0.2 studs were treated as if they were 0.2 studs thick, or if the limitation didn’t apply to CanCollide=false parts. This goes beyond MeshParts, but small parts are often used primarily for graphics, with physics being a secondary feature.

10 Likes

Does anyone know if you can import separate objects at the correct position rather than trying to do it manually? For example If I were making a dog, I’d want the head to be able to move but ROBLOX merges everything for some reason. So you have to eyeball it. Would prefer if it were completely accurate to what I had made in 3D.

No you have to import each part separately

does is always import in the center or can you change the location it spawns?

@jcfc what i personally do (not very optimal) is make a very thin cylinder on both parts that need to be connected and merge them together in studio. It makes locating a little easier and the cylinder doesn’t have to be visible.

So far I’m managing, but with more complex models it becomes much harder. I suppose this is some kind of work-around but obviously it would be better to not have random geometry laying around and perhaps also break the collision physics for it too. I’ll make a feature request about it if I can’t find one already.

If you’re using Blender, this script may be useful for you to perfectly realign (probably multiple) meshes the way they were originally were placed in Blender rather than eyeballing it all the time.~~~

Select a single object in Blender (merge objects if you export multiple at the same time, the Studio mesh importer does the same as far as I know anyway), then run this script in Blender:

Use this code instead: Mesh Parts are live! - #81 by Den_S

OLD/ORIGINAL CODE BELOW

import bpy

export_scale = .01 # configure your fbx export scale in Blender here
import_scale = .01

outp_script = """
local sel = game.Selection:Get();
assert(#sel == 2);
local meshPart = sel[1];
local anchorPart = sel[2];
if (anchorPart:IsA("MeshPart")) then
    meshPart, anchorPart = anchorPart, meshPart;
end
meshPart.CFrame = anchorPart.CFrame * CFrame.new({:.20f}, {:.20f}, {:.20f});
"""

scale = export_scale / import_scale
for obj in bpy.data.objects:
    if obj.select and obj.type == 'MESH':
        dims = obj.dimensions
        mesh = obj.data
        vertices_world = [(obj.matrix_world * vert.co) for vert in mesh.vertices]
        offx = (min([vec.x for vec in vertices_world]) + dims.x * .5) * scale
        offy = (min([vec.y for vec in vertices_world]) + dims.y * .5) * scale
        offz = (min([vec.z for vec in vertices_world]) + dims.z * .5) * scale
        # note: blender has the Z-axis pointing up
        bpy.context.window_manager.clipboard = outp_script.format(offx, offz, -offy)

After doing this, it will copy a Lua script to your system clipboard. In Studio, select both your MeshPart you want to align and another normal BasePart you want to base its alignment on. Then paste and run the Lua script in Studio’s command bar, which will move the selected MeshPart such that it is offset and rotated from the normal BasePart as it were in Blender from the world origin (this alignment BasePart is thus basically the Blender world origin).

If you align multiple MeshParts to the same BasePart this way, you get perfect alignment.

Bit of a messy workflow, but maybe it’s useful to someone else too ;).

3 Likes

That sounds incredible, but i’m a scrub when it comes to scripting. Could you make a quick video tutorial? I’d be extremely thankful. :smiley:

So if i understand correctly, you use the script in both blender and studio?

The original (Python) script is only used in Blender, but that script outputs a Lua script to the system clipboard, which you can paste into Studio’s command bar to actually update the MeshPart CFrame. That generated script changes depending on the bounding box your objects have in Blender.

1 Like

Just select what you want to be mesh, then right click and “export selection”. It will be an .obj file so use some program to export it to .fbx. Remember about 5000 poly limit.

Where is “export selection”

Untitled.png

when I right click on something I want mesh I only see this. I saw export selection once, but I was never able to recreate it.

You need to right click the object in the explorer :P

1 Like

Thanks a million!

While working on my bike i came into this problem, i need to make the cluster that size but cant resize it below 0.2, what do i do now?

You can throw the mesh/texture id into a specialmesh instead and scale that using the mesh’s Scale property if you want.

1 Like