Skip to content

Commit

Permalink
Merge pull request #45 from Yusarina/blender-36-dev
Browse files Browse the repository at this point in the history
Cats Blender Plugin 3.6.6.0 (Only for Blender 3.6)
  • Loading branch information
Yusarina authored Feb 9, 2024
2 parents 84ab895 + b87ba9a commit 020ebe4
Show file tree
Hide file tree
Showing 18 changed files with 392 additions and 1,375 deletions.
10 changes: 2 additions & 8 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'author': 'GiveMeAllYourCats & Hotox, Unofficial version maintained by Yusarina',
'location': 'View 3D > Tool Shelf > CATS',
'description': 'A tool designed to shorten steps needed to import and optimize models into VRChat',
'version': (3, 6, 5, 2), # Has to be (x, x, x) not [x, x, x]!! Only change this version and the dev branch var right before publishing the new update!
'version': (3, 6, 6, 0), # Has to be (x, x, x) not [x, x, x]!! Only change this version and the dev branch var right before publishing the new update!
'blender': (3, 6, 0),
'wiki_url': 'https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-/wiki',
'tracker_url': 'https://github.com/Yusarina/Cats-Blender-Plugin-Unofficial-/issues',
Expand Down Expand Up @@ -295,17 +295,11 @@ def register():
bpy.context.window_manager.addon_support = {'OFFICIAL', 'COMMUNITY'}

# Add shapekey button to shapekey menu
if hasattr(bpy.types, 'MESH_MT_shape_key_specials'): # pre 2.80
bpy.types.MESH_MT_shape_key_specials.append(tools.shapekey.addToShapekeyMenu)
else:
bpy.types.MESH_MT_shape_key_context_menu.append(tools.shapekey.addToShapekeyMenu)
bpy.types.MESH_MT_shape_key_context_menu.append(tools.shapekey.addToShapekeyMenu)

# Disable request warning when using google translate
requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.InsecureRequestWarning)

# Monkey patch fbx exporter to include empty shapekeys
tools.fbx_patch.start_patch_fbx_exporter_timer()

# Apply the settings after a short time, because you can't change checkboxes during register process
tools.settings.start_apply_settings_timer()

Expand Down
6 changes: 6 additions & 0 deletions extentions.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ def register():
default=True
)

Scene.delete_zero_weight_keep_twists = BoolProperty(
name=t('Scene.delete_zero_weight_keep_twists.label'),
description=t('Scene.delete_zero_weight_keep_twists.desc'),
default=False
)

Scene.merge_armatures_cleanup_shape_keys = BoolProperty(
name=t('Scene.merge_armatures_cleanup_shape_keys.label'),
description=t('Scene.merge_armatures_cleanup_shape_keys.desc'),
Expand Down
13 changes: 0 additions & 13 deletions globs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,3 @@
ICON_PROTECT = 'LOCKED'
ICON_UNPROTECT = 'UNLOCKED'
ICON_EXPORT = 'EXPORT'
if bpy.app.version < (2, 79, 9):
ICON_ADD, ICON_REMOVE = 'ZOOMIN', 'ZOOMOUT'
ICON_URL = 'LOAD_FACTORY'
ICON_SETTINGS = 'SCRIPTPLUGINS'
ICON_ALL = 'META_BALL'
ICON_MOD_ARMATURE = 'OUTLINER_OB_ARMATURE'
ICON_FIX_MODEL = 'BONE_DATA'
ICON_EYE_ROTATION = 'MAN_ROT'
ICON_POSE_MODE = 'POSE_DATA'
ICON_SHADING_TEXTURE = 'TEXTURE_SHADED'
ICON_PROTECT = 'KEY_HLT'
ICON_UNPROTECT = 'KEY_DEHLT'
ICON_EXPORT = 'LOAD_FACTORY'
49 changes: 10 additions & 39 deletions resources/translations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ MMDOptions.info5,these on models already set up for Unity,これらはすでに
MMDOptions.info6,and VRChat or it may break your model.,VRChat を使用しないと、モデルが壊れる可能性があります。,VRChat을 사용하지 않으면 모델이 손상될 수 있습니다.
MMDOptions.FixMaterialinfo1,This will apply some vrchat fixes,これにより、いくつかの vrchat 修正が適用されます,이것은 일부 vrchat 수정 사항을 적용합니다.
MMDOptions.FixMaterialinfo2,to materials,材料に,재료에.
OtherOptionsPanel.fbtFix1,Not needed for vrchat anymore!,,
OtherOptionsPanel.fbtFix1,Not needed for vrchat anymore!,VRChat では不要になったので、不要です!,VRChat에서 더 이상 필요하지 않습니다!
OptimizePanel.label,Optimization,最適化,최적화
OptimizePanel.atlasDesc,A greatly improved Atlas Generator.,アトラスジェネレータを大幅に改良。,텍스처들을 결합시켜주는 더욱 향상된 아틀라스 생성기입니다.
OptimizePanel.atlasAuthor,Made by Shotariya,shotaryiaによって作られた,제작자: Shotariya
Expand All @@ -213,10 +213,6 @@ OptimizePanel.matCombOutdated5_2.8,right.,右側にあります。。,오른쪽
OptimizePanel.matCombOutdated6,Or download and install it manually:,または手動でダウンロードしてインストールする:,혹은 직접 다운로드와 설치하기:
OptimizePanel.matCombOutdated6_alt,Download and install it manually:,手動でダウンロードしてインストールする:,직접 다운로드와 설치하기:
OptimizePanel.matCombNotInstalled,Material Combiner is not installed!,マテリアル コンバイナーがインストールされていません!,매테리얼 통합기가 설치되지 않았습니다!
CopyProtectionPanel.label,Copy Protection,コピープロテクション,복사핵 방지
CopyProtectionPanel.desc1,Tries to protect your avatar from Unity cache ripping.,Unity キャッシュリッピングからアバターを保護しようとします。,유니티 캐쉬뜨기로부터 당신의 아바타를 보호하세요.
CopyProtectionPanel.desc2,This protection is not 100% safe!,この保護は100%安全ではありません!,이 방법도 100% 안전하지는 않습니다!
CopyProtectionPanel.desc3,Before use: Read the documentation!,使用前: ドキュメントを読んでください!,사용 전에: 문서를 읽어주세요!
ScalingPanel.label,Model Scaling,,
ScalingPanel.imscaleDisabled1,Immersive Scaler is not enabled!,,
ScalingPanel.imscaleDisabled2,Enable it in your user preferences:,,
Expand Down Expand Up @@ -361,15 +357,6 @@ Very useful for manual decimation",,"선택된 메쉬를 두 부분으로 나누

수동으로 데시메이션을 할 시 매우 유용합니다"
SeparateByShapekeys.success,Successfully separated by shape keys.,,성공적으로 쉐이프키별로 분리됐습니다.
SeparateByCopyProtection.label,Separate by Copy Protection,コピープロテクションに分離する,복사핵 방지로 분리하기
SeparateByCopyProtection.desc,"Separates selected mesh into two parts,
depending on whether it is effected by the Cats Copy Protection or not.

Useful if you have the Copy Protection enabled on multiple selected parts of your model",,"선택된 메쉬를 두 부분으로 나누는데,
Cats의 복사핵 방지의 영향을 받는지 여부에 따라 결정됩니다.

모델의 여러 부분에서 복사 방지를 활성화 한 경우 유용합니다."
SeparateByCopyProtection.success,Successfully separated by shape keys.,,성공적으로 쉐이프키별로 분리됐습니다.
SeparateByX.error.noMesh,No meshes found!,,메쉬가 발견되지 않음!
SeparateByX.error.multipleMesh,"Multiple meshes found!
Please select the mesh you want to separate!",,"여러 메쉬들이 발견됨!
Expand Down Expand Up @@ -519,16 +506,6 @@ BoneMergeButton.desc,"Merges the given percentage of bones together.
This is useful to reduce the amount of bones used by Dynamic Bones.",,
BoneMergeButton.success,Merged bones.,,
ShowError.label,Report: Error,レポート: エラー,
CopyProtectionEnable.label,Enable Protection,保護を有効にする,보호 활성화
CopyProtectionEnable.desc,"Protects your model from piracy. NOT a 100% safe protection!
Read the documentation before use",,
CopyProtectionEnable.success,Model secured!,,
CopyProtectionDisable.label,Disable Protection,保護を無効にする,보호 비활성화
CopyProtectionDisable.desc,Removes the copy protections from this model.,,
CopyProtectionDisable.success,Model un-secured!,,
ProtectionTutorialButton.label,Go to Documentation,ドキュメントに移動,문서로 이동
ProtectionTutorialButton.URL,https://github.com/michaeldegroot/cats-blender-plugin#copy-protection,,
ProtectionTutorialButton.success,Documentation,,
ForumButton.label,Go to the Forums,フォーラムに移動する,포럼으로 가기
ForumButton.URL,https://vrcat.club/threads/cats-blender-plugin.6/,,
ForumButton.success,Forum opened.,,
Expand Down Expand Up @@ -587,9 +564,13 @@ Supported types:
- FBX: .fbx
- DAE: .dae
- ZIP: .zip",,
DecimationLegacy.info1,Decimation will be made a legacy,デシメーションは遺産となるだろう,학살은 유산이 될 것입니다
DecimationLegacy.info2,Compoment Soon we recomend using,すぐに使用することをお勧めします,곧 우리는 다음을 사용하는 것이 좋습니다
DecimationLegacy.info3,Tuxedo instead!,代わりにタキシード!,대신 턱시도!
DecimationLegacy.info1,Decimation will be removed in,デシメーションは次の期間に削除されます,다음 기간에 Decimation이 제거됩니다.
DecimationLegacy.info2,Blender 3.1 please use Tuxdo,Blender 3.1 では Tuxdo を使用してください,블렌더 3.1은 Tuxdo를 사용하세요
DecimationLegacy.info3,Blender Plugin instead!,代わりに Blender プラグインを使用してください。,대신 블렌더 플러그인을 사용하세요!
DecimationMoved1.info1,Decimation has been moved to,,
DecimationMoved1.info2,to legacy features please start,,
DecimationMoved1.info3,using tuxedo instead as this is,,
DecimationMoved1.info4,an obslolete system in cats,,
LegacyDecimationButton.label,Get Tuxedo!,タキシードをゲット!,턱시도 획득!
LegacyDecimationButton.URL,https://github.com/feilen/tuxedo-blender-plugin/releases,,
DecimationHelpButton.success,Opened Github,,
Expand Down Expand Up @@ -668,18 +649,6 @@ ErrorDisplay.eyes3,"If you want Eye Tracking to work, rename this mesh to 'Body'
ErrorDisplay.eyes3_alt,Make sure that the mesh containing the eyes is named 'Body' in order,,
ErrorDisplay.eyes4_alt,to get Eye Tracking to work.,,
ErrorDisplay.continue,Continue to Export,,
OneTexPerMatButton.label,One Material Texture,1つのマテリアルテクスチャ,매테리얼당 하나의 텍스처
OneTexPerMatButton.desc,Have all material slots ignore extra texture slots as these are not used by VRChat.,,
OneTexPerMatOnlyButton.label,One Material Texture,1つのマテリアルテクスチャ,매테리얼당 하나의 텍스처
OneTexPerMatOnlyButton.desc,"Have all material slots ignore extra texture slots as these are not used by VRChat.
Also removes the textures from the material instead of disabling it.
This makes no difference, but cleans the list for the perfectionists",,
ToolsMaterial.error.notCompatible,This function is not yet compatible with Blender 2.8!,,
OneTexPerXButton.success,All materials have one texture now.,,
StandardizeTextures.label,Standardize Textures,テクスチャを標準化する,텍스처들 표준화
StandardizeTextures.desc,"Enables Color and Alpha on every texture, sets the blend method to Multiply
and changes the materials transparency to Z-Transparency",,
StandardizeTextures.success,All textures are now standardized.,,
CombineMaterialsButton.label,Combine Same Materials,同じマテリアルを組み合わせる,같은 매테리얼들을 통합
CombineMaterialsButton.desc,"Combines similar materials into one, reducing draw calls.
Your avatar should visibly look the same after this operation.
Expand Down Expand Up @@ -839,6 +808,8 @@ This will not change how the bones function in any way, it just improves the aes
뼈의 기능에는 영향을 주지 않으며 뼈대(armature)의 미관을 개선할 뿐입니다."
Scene.fix_materials.label,Fix Materials,マテリアルを修正する,매테리얼 고치기
Scene.fix_materials.desc,This will apply some VRChat related fixes to materials,,매테리얼에 일부 VRChat 관련 픽스가 적용됩니다.
Scene.delete_zero_weight_keep_twists.label,Keep bones with _twist,_twist でボーンを維持する,_twist를 사용하여 뼈 유지
Scene.delete_zero_weight_keep_twists.desc,When checked any bones with _twist or Twist in it's name will be kept. This is too ensure twist bones are kept,チェックすると、名前に _twist または Twist が含まれるボーンが保持されます。これにより、ツイストボーンが確実に保持されます,선택하면 이름에 _twist 또는 Twist가 포함된 뼈대가 유지됩니다. 이는 트위스트 뼈가 유지되도록 보장하는 것이기도 합니다.
Scene.remove_rigidbodies_joints.label,Remove Rigidbodies and Joints,リジッドボディとジョイントを除去,Rigidbodies와 Joints 제거
Scene.remove_rigidbodies_joints.desc,"Rigidbodies and joints are used by MMD software to simulate physics.
They are completely useless for VRChat, so removing them is recommended for VRChat users!",,"Rigidbodies와 joints는 MMD software에서 물리연산을 위해 사용되는 것들입니다.
Expand Down
2 changes: 0 additions & 2 deletions tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from . import credits
from . import decimation
from . import eyetracking
from . import fbx_patch
from . import importer
from . import material
from . import rootbone
Expand All @@ -39,7 +38,6 @@
importlib.reload(credits)
importlib.reload(decimation)
importlib.reload(eyetracking)
importlib.reload(fbx_patch)
importlib.reload(importer)
importlib.reload(material)
importlib.reload(rootbone)
Expand Down
39 changes: 3 additions & 36 deletions tools/armature.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,6 @@ def poll(cls, context):
return True

def execute(self, context):
# Todo: Remove this
# armature = Common.get_armature()
# Common.switch('EDIT')
#
# for bone in armature.data.edit_bones:
# bone.tail = bone.head
# bone.tail[2] += 0.1
#
# Common.switch('OBJECT')
#
#
# return {'FINISHED'}

saved_data = Common.SavedData()

is_vrm = False
Expand Down Expand Up @@ -241,35 +228,14 @@ def execute(self, context):
Common.switch('OBJECT')
Common.delete_hierarchy(bpy.data.objects[obj_name])

# Remove objects from different layers and things that are not meshes
get_current_layers = []
if hasattr(bpy.context.scene, 'layers'):
for i, layer in enumerate(bpy.context.scene.layers):
if layer:
get_current_layers.append(i)

if len(armature.children) > 1:
for child in armature.children:
for child2 in child.children:
if child2.type != 'MESH':
Common.delete(child2)
continue
in_layer = False
for i in get_current_layers:
if child2.layers[i]:
in_layer = True
if not in_layer:
Common.delete(child2)

if child.type != 'MESH':
Common.delete(child)
continue
in_layer = False
for i in get_current_layers:
if child.layers[i]:
in_layer = True
if not in_layer and hasattr(bpy.context.scene, 'layers'):
Common.delete(child)

# Unlock all transforms
for i in range(0, 3):
Expand Down Expand Up @@ -900,7 +866,7 @@ def add_eye_children(eye_bone, parent_name):
hips = armature.pose.bones.get('Hips')

obj = hips.id_data
matrix_final = Common.matmul(obj.matrix_world, hips.matrix)
matrix_final = obj.matrix_world @ hips.matrix
# print(matrix_final)
# print(matrix_final[2][3])
# print(fbx)
Expand All @@ -909,7 +875,7 @@ def add_eye_children(eye_bone, parent_name):
# print(hips.head[0], hips.head[1], hips.head[2])
# Rotation of -180 around the X-axis
rot_x_neg180 = Matrix.Rotation(-math.pi, 4, 'X')
armature.matrix_world = Common.matmul(rot_x_neg180, armature.matrix_world)
armature.matrix_world = rot_x_neg180 @ armature.matrix_world

for mesh in meshes:
mesh.rotation_euler = (math.radians(180), 0, 0)
Expand Down Expand Up @@ -1201,6 +1167,7 @@ def add_eye_children(eye_bone, parent_name):
except RuntimeError:
pass

armature.show_in_front = False
wm.progress_end()

if not hierarchy_check_hips['result']:
Expand Down
45 changes: 0 additions & 45 deletions tools/armature_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,51 +715,6 @@ def execute(self, context):
self.report({'INFO'}, done_message)
return {'FINISHED'}


@register_wrap
class SeparateByCopyProtection(bpy.types.Operator):
bl_idname = 'cats_manual.separate_by_copy_protection'
bl_label = t('SeparateByCopyProtection.label')
bl_description = t('SeparateByCopyProtection.desc')
bl_options = {'REGISTER', 'UNDO', 'INTERNAL'}

@classmethod
def poll(cls, context):
obj = context.active_object

if obj and obj.type == 'MESH':
return True

meshes = Common.get_meshes_objects(check=False)
return meshes

def execute(self, context):
saved_data = Common.SavedData()
obj = context.active_object

if not obj or (obj and obj.type != 'MESH'):
Common.unselect_all()
meshes = Common.get_meshes_objects()
if len(meshes) == 0:
saved_data.load()
self.report({'ERROR'}, t('SeparateByX.error.noMesh'))
return {'FINISHED'}
if len(meshes) > 1:
saved_data.load()
self.report({'ERROR'}, t('SeparateByX.error.multipleMesh'))
return {'FINISHED'}
obj = meshes[0]
obj_name = obj.name

done_message = t('SeparateByCopyProtection.success')
if not Common.separate_by_cats_protection(context, obj):
done_message = t('SeparateByX.warn.noSeparation')

saved_data.load(ignore=[obj_name])
self.report({'INFO'}, done_message)
return {'FINISHED'}


@register_wrap
class MergeWeights(bpy.types.Operator):
bl_idname = 'cats_manual.merge_weights'
Expand Down
Loading

0 comments on commit 020ebe4

Please sign in to comment.