From 1692031d8ec661f334fe7cfae354d70ee580ffb8 Mon Sep 17 00:00:00 2001 From: Stone_Blue Date: Tue, 5 Apr 2022 20:40:43 +0000 Subject: [PATCH 1/4] Updated README w/Notes RE: Taniwha's Mu Importer Steps needed for converting imported collider instances, to collider objects useable for MeshPostProcessor import --- Editor/README.md | 122 +++++++++++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 52 deletions(-) diff --git a/Editor/README.md b/Editor/README.md index 97fdf69..eeb45a3 100644 --- a/Editor/README.md +++ b/Editor/README.md @@ -1,52 +1,70 @@ -# Editor - -Files for using the Unity editor - -## Installation - -Place the "Editor" folder anywhere in your project Assets folder. - -## Usage - -### MeshPostProcessor - -Used to perform various operations to models on import to unity - -#### Add Colliders - -To convert objects to colliders on import, add the following strings to the object's name: - -* `_COLLIDER`: Converts to a mesh collider - -* `_SPHERECOLLIDER`: Converts to a sphere collider - -* `_CAPSULECOLLIDER`: Converts to a capsule collider, with the axis along the object's longest axis - -* `_BOXCOLLIDER`: Converts to a box collider. The box will be aligned to the object's local coordinates - -#### Merge Meshes - -Add `_MERGE` to an object's name, and all its child objects meshes will be automatically merged into one. Does not work for skinned meshes - -#### Delete Objects - -Add `_DEL` to an object's name to delete it on import - -#### Trim animations - -Automatically removes any animations with only 2 keyframes to make them easier to edit manually - - -### TexturePostProcessor - -Used to perform various operations on textures on import to Unity. Configured with constants in the top of the file. - -Only works on files with the extension `EXTENSION` (default ".png"). - -#### Specular maps - -If `SPEC_ENABLE` is enabled (default true), textures with the suffix `SPEC_TAG` (default "-spec") will be copied into the alpha channel of the texture without that suffix. For example, the file `foo-spec.png` will be copied into the alpha channel of the imported texture `foo.png`. - -#### Normal maps - -If `NORMAL_ENABLE` is enabled (default true), textures with the suffix `NORMAL_TAG` (default "-spec") will be marked as normal maps on import and when KSP PartTools exports the texture. if `NORMAL_GENERATE` is enabled (default true), then the texture will automatically be converted from a hightmap using Unity's normal map generation tool. +# Editor + +Files for using the Unity editor + +## Installation + +Place the "Editor" folder anywhere in your project Assets folder. + +## Usage + +### MeshPostProcessor + +Used to perform various operations to models on import to unity + +#### Add Colliders + +To convert objects to colliders on import, add the following strings to the object's name: + +* `_COLLIDER`: Converts to a mesh collider + +* `_SPHERECOLLIDER`: Converts to a sphere collider + +* `_CAPSULECOLLIDER`: Converts to a capsule collider, with the axis along the object's longest axis + +* `_BOXCOLLIDER`: Converts to a box collider. The box will be aligned to the object's local coordinates + +#### Merge Meshes + +Add `_MERGE` to an object's name, and all its child objects meshes will be automatically merged into one. Does not work for skinned meshes + +#### Delete Objects + +Add `_DEL` to an object's name to delete it on import + +#### Trim animations + +Automatically removes any animations with only 2 keyframes to make them easier to edit manually + +####Additional Notes (when used in conjunction with Taniwha’s Blender Mu Plugin) + +For those who use Taniwha’s Blender importer, to import existing .mu’s, the following steps & notes + need to be addressed before importing your model into Unity with the MeshPostProcessor installed: + + 1) You need to make sure you only suffix the name of the *object*, and *not* of the mesh, with the above operators. + 2) In Blender, you need to convert any imported collider instances to “real”. + a) To do this, in Object Mode, select the collider instance object, then select: + Object→Apply→Make Instances Real (Shift-Ctrl-A) + b) Then move the new object back into it’s original place in your hierarchy. + Holding Shift+Alt while dragging/dropping will keep its transforms/properties. + c) Rename the *object* name, adding the appropriate operator suffix. + (I suggest removing the “collider:” prefix from the *mesh* name, but thats just personal preference) + 3) Now you have to go into Edit Mode, and fill in all the faces in the mesh. Check that all of + the created face normals are facing outside. + (When you make real the collider instances, only vertices & edges seem to get created, and not faces.) + This will be apparent, if upon Unity import, you get this error, or similar in the Console window: + ‘Can't calculate tangents, because mesh '_BOXCOLLIDER|mesh:|Dupli|' doesn't contain normals.’ + +### TexturePostProcessor + +Used to perform various operations on textures on import to Unity. Configured with constants in the top of the file. + +Only works on files with the extension `EXTENSION` (default ".png"). + +#### Specular maps + +If `SPEC_ENABLE` is enabled (default true), textures with the suffix `SPEC_TAG` (default "-spec") will be copied into the alpha channel of the texture without that suffix. For example, the file `foo-spec.png` will be copied into the alpha channel of the imported texture `foo.png`. + +#### Normal maps + +If `NORMAL_ENABLE` is enabled (default true), textures with the suffix `NORMAL_TAG` (default "-spec") will be marked as normal maps on import and when KSP PartTools exports the texture. if `NORMAL_GENERATE` is enabled (default true), then the texture will automatically be converted from a hightmap using Unity's normal map generation tool. -- 2.45.1 From 16000ea5d42a1d279692a851a1bcf1f0531e6dc9 Mon Sep 17 00:00:00 2001 From: Stone_Blue Date: Tue, 5 Apr 2022 20:48:34 +0000 Subject: [PATCH 2/4] formatting changes --- Editor/README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Editor/README.md b/Editor/README.md index eeb45a3..612c969 100644 --- a/Editor/README.md +++ b/Editor/README.md @@ -36,23 +36,23 @@ Add `_DEL` to an object's name to delete it on import Automatically removes any animations with only 2 keyframes to make them easier to edit manually -####Additional Notes (when used in conjunction with Taniwha’s Blender Mu Plugin) +#### Additional Notes (when used in conjunction with Taniwha’s Blender Mu Importer) For those who use Taniwha’s Blender importer, to import existing .mu’s, the following steps & notes - need to be addressed before importing your model into Unity with the MeshPostProcessor installed: +need to be addressed before importing your model into Unity with the MeshPostProcessor installed. - 1) You need to make sure you only suffix the name of the *object*, and *not* of the mesh, with the above operators. - 2) In Blender, you need to convert any imported collider instances to “real”. - a) To do this, in Object Mode, select the collider instance object, then select: - Object→Apply→Make Instances Real (Shift-Ctrl-A) - b) Then move the new object back into it’s original place in your hierarchy. - Holding Shift+Alt while dragging/dropping will keep its transforms/properties. - c) Rename the *object* name, adding the appropriate operator suffix. - (I suggest removing the “collider:” prefix from the *mesh* name, but thats just personal preference) - 3) Now you have to go into Edit Mode, and fill in all the faces in the mesh. Check that all of - the created face normals are facing outside. - (When you make real the collider instances, only vertices & edges seem to get created, and not faces.) - This will be apparent, if upon Unity import, you get this error, or similar in the Console window: +1) You need to make sure you only suffix the name of the *object*, and *not* of the mesh, with the above operators. +2) In Blender, you need to convert any imported collider instances to “real”. + a) To do this, in Object Mode, select the collider instance object, then select: + Object→Apply→Make Instances Real (Shift-Ctrl-A) + b) Then move the new object back into it’s original place in your hierarchy. + Holding Shift+Alt while dragging/dropping will keep its transforms/properties. + c) Rename the *object* name, adding the appropriate operator suffix. + (I suggest removing the “collider:” prefix from the *mesh* name, but thats just personal preference) +3) Now you have to go into Edit Mode, and fill in all the faces in the mesh. Check that all of + the created face normals are facing outside. + (When you make real the collider instances, only vertices & edges seem to get created, and not faces.) + This will be apparent, if upon Unity import, you get this error, or similar in the Console window: ‘Can't calculate tangents, because mesh '_BOXCOLLIDER|mesh:|Dupli|' doesn't contain normals.’ ### TexturePostProcessor -- 2.45.1 From 042810a5bf7f542251f44347c9e57e0d51a9bf97 Mon Sep 17 00:00:00 2001 From: Stone_Blue Date: Tue, 5 Apr 2022 20:53:31 +0000 Subject: [PATCH 3/4] OMG...yet again formatting edits --- Editor/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Editor/README.md b/Editor/README.md index 612c969..331fc46 100644 --- a/Editor/README.md +++ b/Editor/README.md @@ -38,22 +38,26 @@ Automatically removes any animations with only 2 keyframes to make them easier t #### Additional Notes (when used in conjunction with Taniwha’s Blender Mu Importer) -For those who use Taniwha’s Blender importer, to import existing .mu’s, the following steps & notes +For Blender users who use Taniwha’s Blender Importer to import existing .mu’s, the following steps & notes need to be addressed before importing your model into Unity with the MeshPostProcessor installed. 1) You need to make sure you only suffix the name of the *object*, and *not* of the mesh, with the above operators. 2) In Blender, you need to convert any imported collider instances to “real”. + a) To do this, in Object Mode, select the collider instance object, then select: Object→Apply→Make Instances Real (Shift-Ctrl-A) + b) Then move the new object back into it’s original place in your hierarchy. Holding Shift+Alt while dragging/dropping will keep its transforms/properties. + c) Rename the *object* name, adding the appropriate operator suffix. (I suggest removing the “collider:” prefix from the *mesh* name, but thats just personal preference) + 3) Now you have to go into Edit Mode, and fill in all the faces in the mesh. Check that all of the created face normals are facing outside. (When you make real the collider instances, only vertices & edges seem to get created, and not faces.) This will be apparent, if upon Unity import, you get this error, or similar in the Console window: - ‘Can't calculate tangents, because mesh '_BOXCOLLIDER|mesh:|Dupli|' doesn't contain normals.’ + `Can't calculate tangents, because mesh '_BOXCOLLIDER|mesh:|Dupli|' doesn't contain normals.` ### TexturePostProcessor -- 2.45.1 From 9f44928433f38f5da516599c34fab4042cea9267 Mon Sep 17 00:00:00 2001 From: Stone_Blue Date: Tue, 5 Apr 2022 20:54:44 +0000 Subject: [PATCH 4/4] OMFG... last one, hopefully --- Editor/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Editor/README.md b/Editor/README.md index 331fc46..fae136f 100644 --- a/Editor/README.md +++ b/Editor/README.md @@ -57,6 +57,7 @@ need to be addressed before importing your model into Unity with the MeshPostPro the created face normals are facing outside. (When you make real the collider instances, only vertices & edges seem to get created, and not faces.) This will be apparent, if upon Unity import, you get this error, or similar in the Console window: + `Can't calculate tangents, because mesh '_BOXCOLLIDER|mesh:|Dupli|' doesn't contain normals.` ### TexturePostProcessor -- 2.45.1