stone_blue-readme-update #1

Open
Stone_Blue wants to merge 4 commits from Stone_Blue/KSP-Toolkit:stone_blue-readme-update into main

@ -1,52 +1,75 @@
# Editor # Editor
Files for using the Unity editor Files for using the Unity editor
## Installation ## Installation
Place the "Editor" folder anywhere in your project Assets folder. Place the "Editor" folder anywhere in your project Assets folder.
## Usage ## Usage
### MeshPostProcessor ### MeshPostProcessor
Used to perform various operations to models on import to unity Used to perform various operations to models on import to unity
#### Add Colliders #### Add Colliders
To convert objects to colliders on import, add the following strings to the object's name: To convert objects to colliders on import, add the following strings to the object's name:
* `_COLLIDER`: Converts to a mesh collider * `_COLLIDER`: Converts to a mesh collider
* `_SPHERECOLLIDER`: Converts to a sphere collider * `_SPHERECOLLIDER`: Converts to a sphere collider
* `_CAPSULECOLLIDER`: Converts to a capsule collider, with the axis along the object's longest axis * `_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 * `_BOXCOLLIDER`: Converts to a box collider. The box will be aligned to the object's local coordinates
#### Merge Meshes #### 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 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 #### Delete Objects
Add `_DEL` to an object's name to delete it on import Add `_DEL` to an object's name to delete it on import
#### Trim animations #### Trim animations
Automatically removes any animations with only 2 keyframes to make them easier to edit manually Automatically removes any animations with only 2 keyframes to make them easier to edit manually
#### Additional Notes (when used in conjunction with Taniwhas Blender Mu Importer)
### TexturePostProcessor
For Blender users who use Taniwhas Blender Importer to import existing .mus, the following steps & notes
Used to perform various operations on textures on import to Unity. Configured with constants in the top of the file. need to be addressed before importing your model into Unity with the MeshPostProcessor installed.
Only works on files with the extension `EXTENSION` (default ".png"). 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”.
#### Specular maps
a) To do this, in Object Mode, select the collider instance object, then select:
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`. Object→Apply→Make Instances Real (Shift-Ctrl-A)
#### Normal maps b) Then move the new object back into its original place in your hierarchy.
Holding Shift+Alt while dragging/dropping will keep its transforms/properties.
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.
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 '<your_object_name>_BOXCOLLIDER|mesh:<your_mesh_name>|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.

Loading…
Cancel
Save