Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update blender_3dmigoto_gimi.py to allow multiple objects per classification #334

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Arsinia
Copy link

@Arsinia Arsinia commented Dec 31, 2024

commit 3690cc9 (HEAD -> blender-plugin-merge-meshes, origin/blender-plugin-merge-meshes)
Author: Arsinia [email protected]
Date: Fri Jan 3 02:52:48 2025 -0800

Update blender_3dmigoto_gimi.py to put new files behind options

*  Add options to gate writing the export indices file and copying ib files behind an option that's defaulted to false

commit 8159e47
Author: Arsinia [email protected]
Date: Fri Jan 3 02:14:16 2025 -0800

Update blender_3dmigoto_gimi.py to allow multiple objects per classification

Feature details:
*  Now allows for multiple objects per classification that will be merged on export
   *  For example, you can have a NoelleDress_Waist and NoelleDress_Shirt that will be merged automatically instead of needing to merge meshes before export
*  Modifiers and shape keys are applied during export, and non-numeric vertex groups are removed
*  Exports a new file with the face and vertex indices of each part within a classification.
   *  This allows mods to know which indices correspond to which part and edit the ib to show/hide parts of the mesh
*  Exports the ib files to a new folder "BaseFiles" so mods that modify ib have the original ib to reference and revert to
*  Fixed a minor bug where the classification would be incorrect if any classification has an empty relevant object
   *  Before the code "relevant_objects = [x for x in relevant_objects if x]" would remove empty relevant objects, but this would change the indices which are used to get the classifications
   *  Now it early outs without error if the relevant objects is empty instead of removing the empty objects first

Implementation details:
*  Instead of reading directly from the mesh of the objects exported, we make a copy of each mesh
   *  This may be more expensive, but it allows us to modify the mesh in export without messing with the original object
   *  This is what allows us to apply modifiers, remove shape keys, and merge meshes in export instead of requiring the user to do that manually per export
*  Triangulation now occurs on the object after being duplicated instead of ojn the mesh directly.
   *  This is required for the export indices to be correct, but otherwise it should work the same as before

…ication

Feature details:
*  Now allows for multiple objects per classification that will be merged on export
   *  For example, you can have a NoelleDress_Waist and NoelleDress_Shirt that will be merged automatically instead of needing to merge meshes before export
*  Modifiers and shape keys are applied during export, and non-numeric vertex groups are removed
*  Exports a new file with the face and vertex indices of each part within a classification.
   *  This allows mods to know which indices correspond to which part and edit the ib to show/hide parts of the mesh
*  Exports the ib files to a new folder "BaseFiles" so mods that modify ib have the original ib to reference and revert to
*  Fixed a minor bug where the classification would be incorrect if any classification has an empty relevant object
   *  Before the code "relevant_objects = [x for x in relevant_objects if x]" would remove empty relevant objects, but this would change the indices which are used to get the classifications
   *  Now it early outs without error if the relevant objects is empty instead of removing the empty objects first

Implementation details:
*  Instead of reading directly from the mesh of the objects exported, we make a copy of each mesh
   *  This may be more expensive, but it allows us to modify the mesh in export without messing with the original object
   *  This is what allows us to apply modifiers, remove shape keys, and merge meshes in export instead of requiring the user to do that manually per export
*  Triangulation now occurs on the object after being duplicated instead of ojn the mesh directly.
   *  This is required for the export indices to be correct, but otherwise it should work the same as before
@Arsinia Arsinia force-pushed the blender-plugin-merge-meshes branch from e7adbc3 to 8159e47 Compare January 3, 2025 10:14
*  Add options to gate writing the export indices file and copying ib files behind an option that's defaulted to false
@leotorrez
Copy link
Collaborator

We currently use a plugin called XXMI plugin that nucleates GIMI, SRMI and ZZMI modding tools in a single one. This already includes several of the functions this commit offers with some minor differences

Implementation details:

  • Instead of reading directly from the mesh of the objects exported, we make a copy of each mesh
    • This may be more expensive, but it allows us to modify the mesh in export without messing with the original object
    • This is what allows us to apply modifiers, remove shape keys, and merge meshes in export instead of requiring the user to do that manually per export

Blender has a fast implementation of this that we also use. Allows you to have data only copies of the mesh to operate on and read from. It also already has all modifiers and shapekeys applied to it saving a lot of export time on that "desgraph copy" I believe is the name of these.

@Arsinia Arsinia marked this pull request as draft January 5, 2025 07:05
@Arsinia
Copy link
Author

Arsinia commented Jan 5, 2025

Currently working on adapting relevant features from this to XXMI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants