Skip to content

Commit

Permalink
Merge pull request #67 from michaeldegroot/development
Browse files Browse the repository at this point in the history
0.11.1
  • Loading branch information
absolute-quantum committed Oct 12, 2018
2 parents 7fe6cc6 + d54dcb7 commit ce887f2
Show file tree
Hide file tree
Showing 18 changed files with 410 additions and 219 deletions.
54 changes: 19 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cats Blender Plugin (0.11.0)
# Cats Blender Plugin (0.11.1)

A tool designed to shorten steps needed to import and optimize models into VRChat.
Compatible models are: MMD, XNALara, Mixamo, Source Engine, Unreal Engine, DAZ/Poser, Blender Rigify, Sims 2, Motion Builder, 3DS Max and potentially more
Expand Down Expand Up @@ -150,7 +150,7 @@ This uses an internal dictionary and Google Translate.
- Select the armature you want to fix in the list above the Fix Model button
- 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
- DO NOT delete any main bones by yourself! CATS will merge them and delete 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
Expand Down Expand Up @@ -335,6 +335,23 @@ It checks for a new version automatically once every day.

## Changelog

#### 0.11.1
- **Export**:
- Embed Textures is not longer enabled by default, but can now be enabled in the settings
- **Settings and Updates:**
- Renamed "Updater" panel to "Settings & Updates"
- Added setting to embed textures on export
- Settings are saved into a local settings file
- Issue: Settings get reset with every CATS update currently
- This panel now shows the current CATS version
- **Translations:**
- Added a warning when you are temporarily IP banned by Google Translate
- **Eye Tracking:**
- Wink Right shape keys are now detected more reliably
- **General**:
- Cats no longer unhides everything whenever it does something, it only unhides the current model
- This helps a lot when working with multiple models

#### 0.11.0
- **Optimization:**
- Added new greatly improved Auto Atlas method made by **shotariya**!
Expand Down Expand Up @@ -383,39 +400,6 @@ It checks for a new version automatically once every day.
- **Optimization:**
- Fixed rare error when combining materials

#### 0.10.0
- **Translations:**
- Greatly improved translations by using a new internal dictionary
- Much better shape key translation
- Example: No more Ah, Your and There but Ah, Oh and Ch
- Greatly improved translation speed by storing the google translations locally
- This local google dictionary gets reset every 30 days to stay updated with new translations
- Added "Translate Everything" button
- No longer removes rigidbodies and joints
- Only Fix Model removes them now
- **Model:**
- Join meshes now applies all transforms
- Added new Apply Transforms button
- Added new Remove Doubles button
- More precise than doing it manually but removes less vertices overall
- A little extra button at the end lets you remove doubles like you would do manually
- Fixed files with capital letters in the file extension not importing correctly
- Fixed "Separate by Loose Parts" creating multiple extremely small meshes
- This makes "Separate by Loose Parts" actually useful and not a laggy mess
- **Visemes:**
- Shape Keys Mix Intensity slider is back
- Increased the range of the intensity slider
- **Shapekeys:**
- Greatly improved "Apply Shapekey as Basis"
- Shape keys added to the Basis can be reverted now
- **Credits:**
- Added a patchnotes button
- **General:**
- Slightly reduced startup time
- Updated mmd_tools
- Fixed some typos
- Fixed multiple bugs

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


Expand Down
132 changes: 73 additions & 59 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
# In client.py on line 42 remove the Hyper part, it's not faster at all!
# Just comment it out.
# Also see pull request for TKK change
# Also wm progress in client.py
# Done

bl_info = {
Expand All @@ -111,7 +112,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, 11, 0], # Only change this version and the dev branch var right before publishing the new update!
'version': [0, 11, 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 @@ -225,19 +226,6 @@ class ToolPanel:
bl_region_type = 'TOOLS'
bl_category = 'CATS'

# Armature
bpy.types.Scene.import_mode = bpy.props.EnumProperty(
name="Import Mode",
description="Import Mode",
items=[
("MMD", "MMD", 'Import .pmx/.pmd files'),
("XPS", "XNALara", 'Import .xps/.mesh/.ascii files'),
("SOURCE", "Source", 'Import .smd/.qc/.vta/.dmx files'),
("FBX", "FBX", 'Import .fbx files'),
],
default='MMD'
)

bpy.types.Scene.armature = bpy.props.EnumProperty(
name='Armature',
description='Select the armature which will be used by Cats',
Expand Down Expand Up @@ -718,22 +706,30 @@ class ToolPanel:
)

# Settings
bpy.types.Scene.embed_textures = bpy.props.BoolProperty(
name='Embed Textures on Export',
description='Enable this to embed the texture files into the FBX file upon export.'
'\nUnity will automatically extract these textures and put them into a separate folder.'
'\nThis might not work for everyone and it increases the file size of the exported FBX file',
default=False,
update=tools.settings.update_settings
)
bpy.types.Scene.use_custom_mmd_tools = bpy.props.BoolProperty(
name='Use Custom mmd_tools',
description='Enable this to use your own version of mmd_tools. This will disable the internal cats mmd_tools ',
default=False,
update=tools.settings.set_use_custom_mmd_tools
update=tools.settings.update_settings
)

bpy.types.Scene.disable_vrchat_features = bpy.props.BoolProperty(
name='Disable VRChat Only Features',
description='This will disable features which are solely used for VRChat.'
'\nThe following will be disabled:'
'\n- Eye Tracking'
'\n- Visemes',
default=False,
update=tools.settings.set_use_custom_mmd_tools
)
# bpy.types.Scene.disable_vrchat_features = bpy.props.BoolProperty(
# name='Disable VRChat Only Features',
# description='This will disable features which are solely used for VRChat.'
# '\nThe following will be disabled:'
# '\n- Eye Tracking'
# '\n- Visemes',
# default=False,
# update=tools.settings.update_settings
# )

# Copy Protection - obsolete
# bpy.types.Scene.protection_mode = bpy.props.EnumProperty(
Expand Down Expand Up @@ -921,8 +917,8 @@ def draw(self, context):
col.separator()
col.separator()

ob = bpy.context.active_object
if not ob or ob.mode != 'POSE':
armature = tools.common.get_armature()
if not armature or armature.mode != 'POSE':
row = col.row(align=True)
row.scale_y = 1.1
row.operator('armature_manual.start_pose_mode', icon='POSE_HLT')
Expand Down Expand Up @@ -1099,6 +1095,9 @@ def draw(self, context):
row = col.row(align=True)
row.scale_y = 1.05
col.label('An armature and a mesh are required!', icon='INFO')
row = col.row(align=True)
row.scale_y = 0.75
row.label('Make sure that the mesh has no parent.', icon_value=get_emtpy_icon())
return

row = col.row(align=True)
Expand Down Expand Up @@ -1634,28 +1633,37 @@ def draw(self, context):

class UpdaterPanel(ToolPanel, bpy.types.Panel):
bl_idname = 'VIEW3D_PT_updater_v2'
# bl_label = 'Settings & Updates'
bl_label = 'Updater'
bl_label = 'Settings & Updates'
# bl_label = 'Updater'
bl_options = {'DEFAULT_CLOSED'}

def draw(self, context):
# layout = self.layout
# box = layout.box()
# col = box.column(align=True)
#
layout = self.layout
box = layout.box()
col = box.column(align=True)

row = col.row(align=True)
row.scale_y = 0.8
row.label('Settings:', icon='SCRIPTPLUGINS')
col.separator()

row = col.row(align=True)
row.prop(context.scene, 'embed_textures')
# row = col.row(align=True)
# row.prop(context.scene, 'use_custom_mmd_tools')
# # row = col.row(align=True)
# # row.prop(context.scene, 'disable_vrchat_features')
#
# if tools.settings.settings_changed():
# col.separator()
# row = col.row(align=True)
# row.scale_y = 0.8
# row.label('Settings have changed.', icon='ERROR')
# row = col.row(align=True)
# row.scale_y = 0.8
# row.label('Restart Blender to apply them.', icon_value=get_emtpy_icon())
# row = col.row(align=True)
# row.prop(context.scene, 'disable_vrchat_features')

if tools.settings.settings_changed():
col.separator()
row = col.row(align=True)
row.scale_y = 0.8
row.label('Restart required.', icon='ERROR')
row = col.row(align=True)
row.scale_y = 0.8
row.label('Some changes require a Blender restart.', icon_value=get_emtpy_icon())
row = col.row(align=True)
row.operator('settings.revert', icon='RECOVER_LAST')

# Updater
# addon_updater_ops.check_for_update_background()
Expand Down Expand Up @@ -1763,18 +1771,7 @@ def draw(self, context):
col = box.column(align=True)
row = col.row(align=True)

version_str = 'Cats Blender Plugin ('
if len(version) > 0:
version_str += str(version[0])
for index, i in enumerate(version):
if index == 0:
continue
version_str += '.' + str(version[index])
if dev_branch:
version_str += '-dev'
version_str += ')'

row.label(version_str, icon_value=tools.supporter.preview_collections["custom_icons"]["cats1"].icon_id)
row.label('Cats Blender Plugin (' + tools.common.version_str + ')', icon_value=tools.supporter.preview_collections["custom_icons"]["cats1"].icon_id)
col.separator()
row = col.row(align=True)
row.label('Created by GiveMeAllYourCats and Hotox')
Expand Down Expand Up @@ -1839,6 +1836,22 @@ def get_emtpy_icon():
return tools.supporter.preview_collections["custom_icons"]["empty"].icon_id


def set_cats_verion_string():
version_str = ''
if dev_branch and len(version) > 2:
version[2] += 1
if len(version) > 0:
version_str += str(version[0])
for index, i in enumerate(version):
if index == 0:
continue
version_str += '.' + str(version[index])
if dev_branch:
version_str += '-dev'

tools.common.version_str = version_str


classesToRegister = [
ArmaturePanel,
tools.importer.ImportAnyModel,
Expand Down Expand Up @@ -1915,7 +1928,7 @@ def get_emtpy_icon():
tools.atlas.AutoAtlasNewButton,
tools.atlas.InstallShotariya,
tools.atlas.ShotariyaButton,
#tools.atlas.AutoAtlasButton,
# tools.atlas.AutoAtlasButton,
tools.atlas.AtlasHelpButton,
tools.atlas.MaterialsGroup,
tools.atlas.GenerateMaterialListButton,
Expand All @@ -1935,6 +1948,7 @@ def get_emtpy_icon():

UpdaterPanel,
UpdaterPreferences,
tools.settings.RevertChangesButton,

SupporterPanel,
tools.supporter.PatreonButton,
Expand Down Expand Up @@ -1976,8 +1990,8 @@ def register():
bpy.types.Scene.material_list = bpy.props.CollectionProperty(type=tools.atlas.MaterialsGroup)
bpy.types.Scene.material_list_index = bpy.props.IntProperty(default=0)

if dev_branch and len(version) > 2:
version[2] += 1
# Set cats version string
set_cats_verion_string()

tools.supporter.load_other_icons()
tools.supporter.load_supporters()
Expand All @@ -1993,7 +2007,7 @@ def register():
# Disable request warning when using google translate
requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)

# tools.settings.start_apply_settings_timer()
tools.settings.start_apply_settings_timer()

print("### Loaded CATS successfully!")

Expand Down
14 changes: 13 additions & 1 deletion addon_updater_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import bpy
from bpy.app.handlers import persistent
import os
import tools.common

# updater import, import safely
# Prevents popups for users with invalid python installs e.g. missing libraries
Expand Down Expand Up @@ -828,6 +829,11 @@ def update_settings_ui(self, context, element=None):
if element == None: element = self.layout
box = element.box()

col = box.column(align=True)
row = col.row(align=True)
row.scale_y = 0.8
row.label('Updates:', icon='LOAD_FACTORY')

# in case of error importing updater
if updater.invalidupdater == True:
box.label("Error initializing updater code:")
Expand All @@ -838,7 +844,7 @@ def update_settings_ui(self, context, element=None):

# auto-update settings
# box.label("Cats Updater")
row = box.row()
# row = box.row()

# special case to tell user to restart blender, if set that way
if updater.auto_reload_post_update == False:
Expand Down Expand Up @@ -969,6 +975,12 @@ def update_settings_ui(self, context, element=None):
# col.operator(addon_updater_restore_backup.bl_idname, backuptext)

row = box.row()

row.scale_y = 0.1
row.label('Current Cats version: ' + tools.common.version_str)
col.separator()
row = box.row()

row.scale_y = 0.7
lastcheck = updater.json["last_check"]
if updater.error != None and updater.error_msg != None:
Expand Down
2 changes: 2 additions & 0 deletions googletrans/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def _translate(self, text, dest, src):
url = urls.TRANSLATE.format(host=self._pick_service_url())
r = self.session.get(url, params=params)

# print('JSON:', r.text)

data = utils.format_json(r.text)
return data

Expand Down
2 changes: 1 addition & 1 deletion googletrans/gtoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _update(self):
r = self.session.get(self.host, verify=False)

rawtkk = self.RE_RAWTKK.search(r.text)
if rawtkk is not None:
if rawtkk:
self.tkk = rawtkk.group(1)
return

Expand Down
7 changes: 6 additions & 1 deletion googletrans/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,16 @@ def legacy_format_json(original):
# use slicing to extract those parts of the original string to be kept
text = text[:p] + states[j][1] + text[nxt:]

converted = json.loads(text)
try:
converted = json.loads(text)
except json.JSONDecodeError:
raise RuntimeError(text)

return converted


def format_json(original):
#original = '<!DOCTYPE html><html lang=en><meta charset=utf-8><meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"><title>Error 403 (Forbidden)!!1</title><style>*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}</style><a href=//www.google.com/><span id=logo aria-label=Google></span></a><p><b>403.</b> <ins>That’s an error.</ins><p>Your client does not have permission to get URL <code>/translate_a/single?client=t&amp;sl=auto&amp;tl=en&amp;hl=en&amp;dt=at&amp;dt=bd&amp;dt=ex&amp;dt=ld&amp;dt=md&amp;dt=qca&amp;dt=rw&amp;dt=rm&amp;dt=ss&amp;dt=t&amp;ie=UTF-8&amp;oe=UTF-8&amp;otf=1&amp;ssel=0&amp;tsel=0&amp;tk=684737.684737&amp;q=test</code> from this server. <ins>That’s all we know.</ins></p></p></a></meta></meta></html></!DOCTYPE>'
try:
converted = json.loads(original)
except ValueError:
Expand Down
Binary file removed resources/icons/supporters/chikan_celeryman.png
Binary file not shown.
Binary file removed resources/icons/supporters/liquid.png
Binary file not shown.
Loading

0 comments on commit ce887f2

Please sign in to comment.