本帖最后由 cg小白兔 于 2024-4-23 10:46 编辑
What's it good for?
You only need parts of the awesome model you have just purchased?
With this tool you can extract what you need within seconds.
You will get a ready to use Prefab with sliced textures and remapped UVs.
Super easy to use.
Just draw on the mesh and hit the "Extract Mesh" button.
Prefab generation
After extraction the tool will generate a prefab which uses all the new meshes, materials and textures.
Material based separation & Sub Mesh Support
Preserve or merge sub meshes. Either based on sub mesh index or material.
Pivot modifier
Choose the pivot freely for your new mesh. Snap the pivot to any vertex.
Skinned Mesh Support
Skinned meshes are BAKED in their current pose and then exported as a static mesh (just like MeshRenderer).
Bones and BoneWeight Support
Bones are added to the exported prefab. Bone weights and bind poses are added to the mesh.
OBJ files can not contain bone information. That's a file format limitation.
Blend Shape Support
Blend shapes are added to the exported prefab. Blend shape frames are added to the mesh.
OBJ files can not contain blend shape information. That's a file format limitation.
Multi Object Support
Extract meshes from multiple objects and export them separately or combine them to one single mesh.
OBJ Export
Export your meshes as .obj + .mtl files. Use this if you want to open the mesh in other 3D tools like Blender, Maya, Max,... .
OBJ files can not contain multiple UV sets. That's a file format limitation.
Texture Export*
Creates a new (smaller) texture based on the selected polygons. It also remaps the UVs to match your new mesh.
*Textures are searched by common property names like '_MainTex' or '_BaseMap'. Please check the manual for more details. You can add custom shader properties in the MaterialPropertyExtensions.cs class. - It also does ignore tiling and offests set in shaders.
Tested with high poly meshes
Though you should keep it under a hundred thousand triangles or else the extraction may take a while.
None-Destructive workflow
Your original assets remain the same. This just generates new assets based on their data.
Undo/Redo for selections
Full Source Code included!
I publish this asset with full source code because as a developer I know how annoying it is to not have source code access. If you like it then please remind others to purchase the plugin. Don't just copy and paste it everywhere.
Supports Unity 2020, 2021, 2022, 2023, ... LTS
Please be aware that for high poly models (> 100k) the select-linked feature may not always work. It has to analyze the whole mesh and it would simply take too long. However, you can change the max time limit for select-linked in the settings. - HINT: Instead of increasing the time limit use select-linked multiple times from multiple locations to build up your selection.
Please be aware that models close to or above 200k are not officially supported. There is no hard limit, it's just that it really depends on how fast your CPU is and generally that's where the performance starts to degrade noticeably.
Usage
1) Open the tool via Tools > Mesh Extractor > Start (or via the Tools bar).
2) Select the object(s) you want to extract from.
3) Pick the polygons which you want to extract.
4) Hit the "Extract Mesh" button (don't forget to set the pivot).
HINT 1:
You can add new objects to extract from while painting if you hold CTRL and click an object. Though to remove it you will have to switch to the select objects mode.
HINT 2:
Select one single triangle and then hit the "Select Linked" button. It may already select everything you need.
HINT 3:
Hold "V" while moving the pivot to snap it to a vertex.
HINT 4:
If you press S while selecting you can trigger "Select Linked". And if you press SHIFT + S you can deselect-linked.
HINT 5:
Reduce the brush size to 0 to select only one triangle at a time. Use SHIFT + MOUSE WHEEL to change the brush size.
它有什么用?
您只需要刚刚购买的超棒模型的一部分?
有了这款工具,您可以在几秒钟内提取出您需要的部分。
您将得到一个带有切片纹理和重映射 UV 的预制件,随时可以使用。
使用超级简单。
只需在网格上绘图,然后点击 "提取网格 "按钮即可。
生成预制件
提取后,该工具将生成一个使用所有新网格、材质和纹理的预制件。
基于材质的分离和子网格支持
保留或合并子网格。可根据子网格索引或材质保留或合并子网格。
枢轴修改器
为新网格自由选择枢轴。将枢轴固定到任意顶点。
支持蒙皮网格
蒙皮网格以当前姿势烘焙,然后作为静态网格导出(就像网格渲染器一样)。
支持骨骼和骨骼重量
骨骼会添加到导出的预制件中。骨骼重量和绑定姿势会添加到网格中。
OBJ 文件不能包含骨骼信息。这是文件格式的限制。
混合形状支持
混合形状会添加到导出的预制件中。混合形状框架会添加到网格中。
OBJ 文件不能包含混合形状信息。这是文件格式的限制。
多对象支持
从多个对象中提取网格并分别导出,或将它们合并为一个网格。
OBJ 导出
将网格导出为 .obj + .mtl 文件。如果您想在 Blender、Maya、Max 等其他 3D 工具中打开网格,请使用此功能。.
OBJ 文件不能包含多个 UV 设置。这是文件格式的限制。
纹理导出
根据选定的多边形创建新的(较小的)纹理。它还会重新映射 UV 以匹配新网格。
*纹理会根据"_MainTex "或"_BaseMap "等常用属性名称进行搜索。更多详情请查看手册。您可以在 MaterialPropertyExtensions.cs 类中添加自定义着色器属性。- 它还会忽略着色器中设置的平铺和 offests。
使用高多边形网格进行测试
但应保持在十万个三角形以下,否则提取可能需要一段时间。
非破坏性工作流程
原始资产保持不变。这只是根据其数据生成新的资产。
撤销/重做选择
包含完整源代码!
我发布此资产时附带了完整的源代码,因为作为一名开发人员,我知道无法访问源代码是多么令人讨厌。如果您喜欢,请提醒其他人购买该插件。不要随处复制粘贴。
支持 Unity 2020、2021、2022、2023、... LTS
请注意,对于高多边形模型(大于 10 万),选择链接功能可能无法始终工作。它必须分析整个网格,而这将耗时过长。不过,您可以在设置中更改选择链接的最大时间限制。- 提示: 与其增加时间限制,不如从多个位置多次使用 select-linked 来建立您的选择。
请注意,官方不支持接近或超过 20 万的模型。这并没有硬性限制,只是取决于 CPU 的速度,一般来说,速度越快,性能下降越明显。
使用方法
1) 通过 "工具">"网格提取器">"开始"(或通过 "工具栏")打开工具。
2) 选择要提取的对象。
3) 选择要提取的多边形。
4) 点击 "提取网格 "按钮(不要忘记设置枢轴)。
提示 1:
如果按住 CTRL 并单击一个对象,您可以在绘制时添加新的对象来提取网格。不过要移除它,您必须切换到选择对象模式。
提示 2:
选择一个三角形,然后点击 "选择链接 "按钮。它可能已经选择了您需要的所有内容。
提示 3:
移动枢轴时按住 "V "键,将其捕捉到一个顶点。
提示 4:
如果在选择时按 S 键,可以触发 "选择链接"。如果按 SHIFT + S,则可以取消选择链接。
提示 5:
将画笔大小减小到 0,一次只选择一个三角形。使用 SHIFT + 鼠标滚轮更改画笔大小。
|