Skip to content

Commit

Permalink
Merge pull request #44 from michaeldegroot/development
Browse files Browse the repository at this point in the history
0.8.1
  • Loading branch information
absolute-quantum authored May 31, 2018
2 parents 112a04a + b04fcc1 commit 8a7a970
Show file tree
Hide file tree
Showing 28 changed files with 387 additions and 235 deletions.
161 changes: 74 additions & 87 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cats Blender Plugin (0.8.0)
# Cats Blender Plugin (0.8.1)

A tool designed to shorten steps needed to import and optimize models into VRChat.
Compatible models are: MMD, XNALara, Mixamo, Unreal Engine, DAZ/Poser, Blender Rigify, Sims 2, Motion Builder, 3DS Max and potentially more
Compatible models are: MMD, XNALara, Mixamo, Source Engine, Unreal Engine, DAZ/Poser, Blender Rigify, Sims 2, Motion Builder, 3DS Max and potentially more

With Cats it takes only a few minutes to upload your model into VRChat.
All the hours long processes of fixing your models are compressed into a few functions!
Expand Down Expand Up @@ -73,17 +73,17 @@ This tries to completely fix your model with one click.

##### Fix Model
- Fixes your model automatically by:
- Reparenting bones
- Removing unnecessary bones
- Renaming and translating objects and bones
- Mixing weight paints
- Rotating the hips
- Joining meshes
- Removing rigidbodies, joints and bone groups
- Removing bone constraints
- Deleting unused vertex groups
- Using the correct shading
- Making it compatible with Full Body Tracking
- Reparenting bones
- Removing unnecessary bones
- Renaming and translating objects and bones
- Mixing weight paints
- Rotating the hips
- Joining meshes
- Removing rigidbodies, joints and bone groups
- Removing bone constraints
- Deleting unused vertex groups
- Using the correct shading
- Making it compatible with Full Body Tracking

**special thanks to @ProfessorSnep#0001, @Mimi#4114, @persia#0123 and @Gallium#7020 <3 <3**

Expand Down Expand Up @@ -135,31 +135,31 @@ Works by sending a request to the Google Translate service. This feature can be
##### Merge Armatures
- Merges the selected armature into the selected base armature.
- **How to use:**
- Use "Fix Model" on both armatures
- Ignore the "Bones are missing" warning if one of the armatures is incomplete (e.g hair only)
- If you don't want to use "Fix Model" make sure that the armature follows the CATS bone structure (https://i.imgur.com/F5KEt0M.png)
- DO NOT delete any main bones by yourself! CATS will merge them and deletes all unused bones afterwards
- Move the mesh (and only the mesh!) of the merge armature to the desired position
- You can use Move, Scale and Rotate
- CATS will position the bones according to the mesh automatically
- If you want multiple objects from the same model it is often better to duplicate the armature for each of them and merge them individually
- Select the base armature and the armature you want to merge into the base armature
- If CATS can't detect the bone structure automatically: select a bone you want to attach the new armature to
- E.g.: For a hair armature select "Head" as the bone
- Press the "Merge Armatures" button -> Done!
- Use "Fix Model" on both armatures
- Ignore the "Bones are missing" warning if one of the armatures is incomplete (e.g hair only)
- If you don't want to use "Fix Model" make sure that the armature follows the CATS bone structure (https://i.imgur.com/F5KEt0M.png)
- DO NOT delete any main bones by yourself! CATS will merge them and deletes all unused bones afterwards
- Move the mesh (and only the mesh!) of the merge armature to the desired position
- You can use Move, Scale and Rotate
- CATS will position the bones according to the mesh automatically
- If you want multiple objects from the same model it is often better to duplicate the armature for each of them and merge them individually
- Select the base armature and the armature you want to merge into the base armature
- If CATS can't detect the bone structure automatically: select a bone you want to attach the new armature to
- E.g.: For a hair armature select "Head" as the bone
- Press the "Merge Armatures" button -> Done!

##### Attach Mesh to Armature
- Attaches the selected mesh to the selected armature.
- **How to use:**
- Move the mesh to the desired position
- You can use Move, Scale and Rotate
- INFO: The mesh will only be assigned to the selected bone
- E.g.: A jacket won't work, because it requires multiple bones.
- E.g.: A ring on a finger works perfectly, because the ring only needs one bone to move with (the finger bone)
- Select the base armature and the mesh you want to attach to the base armature
- Select the bone you want to attach the mesh to
- Press the "Attach Mesh" button -> Done!
- Move the mesh to the desired position
- You can use Move, Scale and Rotate
- INFO: The mesh will only be assigned to the selected bone
- E.g.: A jacket won't work, because it requires multiple bones.
- E.g.: A ring on a finger works perfectly, because the ring only needs one bone to move with (the finger bone)
- Select the base armature and the mesh you want to attach to the base armature
- Select the bone you want to attach the mesh to
- Press the "Attach Mesh" button -> Done!

##### Useful tip:
- You can change the rest position of your model by using this method:
https://nixart.wordpress.com/2013/03/28/modifying-the-rest-pose-in-blender/
Expand Down Expand Up @@ -325,66 +325,53 @@ It checks for a new version automatically once every day.

## Changelog

#### 0.8.1
- **Model:**
- Now straightens up the head bone
- Fixed bone morphs not converting correctly
- Fixed bones rotating the mesh twice as far
- Fixed eye rotation testing no longer working after changing the eye movement scale
- Fixed some shading issues after fixing the model
- **General:**
- Updated mmd_tools

#### 0.8.0
- Model:
- Added "Merge Armatures" button!
- This merges two selected armatures together.
- Added "Attach mesh" button!
- This attaches a mesh to a selected bone in an armature.
- Custom avatars are a breeze now!
- Added support for Source Engine Models!
- Added new "Custom Model Creation" panel
- Moved some model options into a new "Model Options" panel
- Moved Translations into the new "Model Options" panel
- Added a lot of new model options to the "Model Options" panel
- "Fix Model" now sets the roll of all bones to 0
- This fixes a lot of finger issues in Unity!
- "Fix Model" now removes the standard lamp, camera and cube
- Full Body Tracking Fix is not longer enabled by default
- More models are now compatible (please report non working models to us)
- Fixed: Undoing the operation after a model import no longer undoes the import as well
- Added "Merge Armatures" button!
- This merges two selected armatures together.
- Added "Attach mesh" button!
- This attaches a mesh to a selected bone in an armature.
- Custom avatars are a breeze now!
- Added support for Source Engine Models!
- Added new "Custom Model Creation" panel
- Moved some model options into a new "Model Options" panel
- Added a lot of new model options to that panel
- "Fix Model" now sets the roll of all bones to 0
- This fixes a lot of finger issues in Unity!
- "Fix Model" now removes the standard lamp, camera and cube
- Full Body Tracking Fix is not longer enabled by default
- More models are now compatible (please report non working models to us)
- Fixed: Undoing the operation after a model import no longer undoes the import as well
- Eye Tracking:
- Now shows a warning when important objects aren't named correctly
- Now shows a warning when important objects aren't named correctly
- Copy Protection:
- Added Export button into the panel after enabling the protection
- Now automatically triangulates the model
- Fixes holes appearing after export to Unity
- Updated documentation
- Step 6 now shows how to fix all remaining lighting issues
- Added Export button into the panel after enabling the protection
- Now automatically triangulates the model
- Fixes holes appearing after export to Unity
- Updated documentation
- Step 6 now shows how to fix all remaining lighting issues
- Atlas:
- Changed: Meshes no longer need an armature to be selectable
- Changed: Meshes no longer need an armature to be selectable
- Supporters:
- The supporter list is now synced with an online repository
- It can now be updated on the fly without having to update the whole plugin
- New supporter list features are available now, check them out!
- The supporter list is now synced with an online repository
- It can now be updated on the fly without having to update the whole plugin
- New supporter list features are available now, check them out!
- General:
- Mesh selections are no longer shown if there is only one mesh
- Updated mmd_tools
- Fixed lots of bugs and typos

#### 0.7.2
- Changed: Copy Protection: Does now work on multiple meshes.
- Fixed: Copy Protection: The lighting bugs are now gone! Therefore we removed the randomization options.
- Either use the Export button within Cats or set the export option by yourself:
Geometries > Smoothing > Set to "Face"
- Added: Model: "Fix Model" now sets the bone layer to 0.
- This means that shadow bones are now editable
- Added: Model: More models are now compatible (please report non working models to us)
- Added: Model: Now shows a small info box about the bone length warning when full body fix is enabled
- Fixed: Model: Separating by Loose Parts should no longer crash Blender.
- Instead it might lag (but that's better than crashing)
- Fixed: Model: "Fix Model" now disables Backface Culling
- Fixed: Atlas: Now unhides everything in edit mode
- Fixed: "Remove Doubles" causing an error
- Fixed: More bugs

#### 0.7.1
- Added: Model: The Full Body Fix is now a toggleable option
- If you get the "spine length zero" warning in Unity you can ignore it as it shouldn't break anything.
But if it really does cause issues, uncheck this option
- Added: Copy protection: Added "Go to Documentation" button

See the full changelog [here](https://github.com/michaeldegroot/cats-blender-plugin/releases).
- Mesh selections are no longer shown if there is only one mesh
- Updated mmd_tools
- Fixed lots of bugs and typos

Read the full changelog [here](https://github.com/michaeldegroot/cats-blender-plugin/releases).


## Roadmap
Expand Down
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
'author': 'GiveMeAllYourCats',
'location': 'View 3D > Tool Shelf > CATS',
'description': 'A tool designed to shorten steps needed to import and optimize MMD models into VRChat',
'version': [0, 8, 0], # Only change this version and the dev branch var right before publishing the new update!
'version': [0, 8, 1], # Only change this version and the dev branch var right before publishing the new update!
'blender': (2, 79, 0),
'wiki_url': 'https://github.com/michaeldegroot/cats-blender-plugin',
'tracker_url': 'https://github.com/michaeldegroot/cats-blender-plugin/issues',
Expand Down Expand Up @@ -708,7 +708,7 @@ def draw(self, context):
info = news.get('info')
icon = news.get('icon')
custom_icon = news.get('custom_icon')
if info:
if info and not news.get('disabled'):
showed_info = True

row = col.row(align=True)
Expand Down
6 changes: 5 additions & 1 deletion mmd_tools_local/bpyutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,13 @@ def __init__(self, obj):
if bpy.app.version < (2, 75, 0):
def shape_key_remove(self, key):
obj = self.__obj
key_blocks = obj.data.shape_keys.key_blocks # key.id_data.key_blocks
relative_key_map = {k.name:getattr(k.relative_key, 'name', '') for k in key_blocks}
obj.active_shape_key_index = key_blocks.find(key.name)
bpy.context.scene.objects.active = obj
obj.active_shape_key_index = key.id_data.key_blocks.find(key.name)
bpy.ops.object.shape_key_remove()
for k in key_blocks:
k.relative_key = key_blocks.get(relative_key_map[k.name], key_blocks[0])
else:
def shape_key_remove(self, key):
self.__obj.shape_key_remove(key)
Expand Down
3 changes: 2 additions & 1 deletion mmd_tools_local/core/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def material(self):

def __same_image_file(self, image, filepath):
if image and image.source == 'FILE':
img_filepath = image.filepath_from_user()
img_filepath = bpy.path.abspath(image.filepath) # image.filepath_from_user()
if img_filepath == filepath:
return True
try:
Expand Down Expand Up @@ -268,6 +268,7 @@ def update_diffuse_color(self):
mat = self.__material
mmd_mat = mat.mmd_material
mat.diffuse_color = self._mixDiffuseAndAmbient(mmd_mat)
mat.diffuse_intensity = 0.8

def update_alpha(self):
mat = self.__material
Expand Down
2 changes: 2 additions & 0 deletions mmd_tools_local/core/pmx/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,9 +1090,11 @@ def get_uv_offsets(v):
for i, kb in shape_key_list:
shape_key_name = kb.name
logging.info(' - processing shape key: %s', shape_key_name)
kb_mute, kb.mute = kb.mute, False
meshObj.active_shape_key_index = i
mesh = meshObj.to_mesh(bpy.context.scene, True, 'PREVIEW', False)
mesh.transform(pmx_matrix)
kb.mute = kb_mute
if len(mesh.vertices) != len(base_mesh.vertices):
logging.warning(' * Error! vertex count mismatch!')
continue
Expand Down
Loading

0 comments on commit 8a7a970

Please sign in to comment.