Skip to content

Commit

Permalink
Merge pull request #57 from Yusarina/blender-36-dev
Browse files Browse the repository at this point in the history
Cats Blender Plugin 3.6.6.3 (Only for Blender 3.6)
  • Loading branch information
Yusarina authored Mar 1, 2024
2 parents f4c2932 + ec0c9f1 commit 8a954b5
Show file tree
Hide file tree
Showing 9 changed files with 1,412 additions and 61 deletions.
127 changes: 125 additions & 2 deletions extentions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# MIT License

from .tools import common as Common
from .tools.common import wrap_dynamic_enum_items
from .tools import atlas as Atlas
Expand All @@ -15,6 +14,12 @@


def register():
Scene.export_shapekeys_csv = BoolProperty(
name=t('Scene.shapekeycsv.label'),
description=t('Scene.shapekeycsv.desc'),
default = False
)

Scene.armature = EnumProperty(
name=t('Scene.armature.label'),
description=t('Scene.armature.desc'),
Expand Down Expand Up @@ -230,12 +235,29 @@ def register():
)

# Eye Tracking
Scene.eye_mode = EnumProperty(
name=t('Scene.eye_mode.label'),
description=t('Scene.eye_mode.desc'),
items=[
("CREATION", t('Scene.eye_mode.creation.label'), t('Scene.eye_mode.creation.desc')),
("TESTING", t('Scene.eye_mode.testing.label'), t('Scene.eye_mode.testing.desc'))
],
update=Eyetracking.stop_testing
)

Scene.mesh_name_eye = EnumProperty(
name=t('Scene.mesh_name_eye.label'),
description=t('Scene.mesh_name_eye.desc'),
# get_meshes is used elsewhere than for EnumProperty items so must contain the sorting itself
items=wrap_dynamic_enum_items(Common.get_meshes, 'mesh_name_eye', sort=False),
)

Scene.head = EnumProperty(
name=t('Scene.head.label'),
description=t('Scene.head.desc'),
items=wrap_dynamic_enum_items(Common.get_bones_head, 'head'),
)

Scene.eye_left = EnumProperty(
name=t('Scene.eye_left.label'),
description=t('Scene.eye_left.desc'),
Expand All @@ -248,6 +270,107 @@ def register():
items=wrap_dynamic_enum_items(Common.get_bones_eye_r, 'eye_right'),
)

Scene.wink_left = EnumProperty(
name=t('Scene.wink_left.label'),
description=t('Scene.wink_left.desc'),
items=wrap_dynamic_enum_items(Common.get_shapekeys_eye_blink_l, 'wink_left', sort=False),
)

Scene.wink_right = EnumProperty(
name=t('Scene.wink_right.label'),
description=t('Scene.wink_right.desc'),
items=wrap_dynamic_enum_items(Common.get_shapekeys_eye_blink_r, 'wink_right', sort=False),
)

Scene.lowerlid_left = EnumProperty(
name=t('Scene.lowerlid_left.label'),
description=t('Scene.lowerlid_left.desc'),
items=wrap_dynamic_enum_items(Common.get_shapekeys_eye_low_l, 'lowerlid_left', sort=False),
)

Scene.lowerlid_right = EnumProperty(
name=t('Scene.lowerlid_right.label'),
description=t('Scene.lowerlid_right.desc'),
items=wrap_dynamic_enum_items(Common.get_shapekeys_eye_low_r, 'lowerlid_right', sort=False),
)

Scene.disable_eye_movement = BoolProperty(
name=t('Scene.disable_eye_movement.label'),
description=t('Scene.disable_eye_movement.desc'),
subtype='DISTANCE'
)

Scene.disable_eye_blinking = BoolProperty(
name=t('Scene.disable_eye_blinking.label'),
description=t('Scene.disable_eye_blinking.desc'),
subtype='NONE'
)

Scene.eye_distance = FloatProperty(
name=t('Scene.eye_distance.label'),
description=t('Scene.eye_distance.desc'),
default=0.8,
min=0.0,
max=2.0,
step=1.0,
precision=2,
subtype='FACTOR'
)

Scene.eye_rotation_x = IntProperty(
name=t('Scene.eye_rotation_x.label'),
description=t('Scene.eye_rotation_x.desc'),
default=0,
min=-19,
max=25,
step=1,
subtype='FACTOR',
update=Eyetracking.set_rotation
)

Scene.eye_rotation_y = IntProperty(
name=t('Scene.eye_rotation_y.label'),
description=t('Scene.eye_rotation_y.desc'),
default=0,
min=-19,
max=19,
step=1,
subtype='FACTOR',
update=Eyetracking.set_rotation
)

Scene.iris_height = IntProperty(
name=t('Scene.iris_height.label'),
description=t('Scene.iris_height.desc'),
default=0,
min=0,
max=100,
step=1,
subtype='FACTOR'
)

Scene.eye_blink_shape = FloatProperty(
name=t('Scene.eye_blink_shape.label'),
description=t('Scene.eye_blink_shape.desc'),
default=1.0,
min=0.0,
max=1.0,
step=1.0,
precision=2,
subtype='FACTOR'
)

Scene.eye_lowerlid_shape = FloatProperty(
name=t('Scene.eye_lowerlid_shape.label'),
description=t('Scene.eye_lowerlid_shape.desc'),
default=1.0,
min=0.0,
max=1.0,
step=1.0,
precision=2,
subtype='FACTOR'
)

# Visemes
Scene.mesh_name_viseme = EnumProperty(
name=t('Scene.mesh_name_viseme.label'),
Expand Down
106 changes: 104 additions & 2 deletions resources/translations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,20 @@ EyeTrackingPanel.warn.assignEyes2, to the eyes in Unity!, ユニティ
VisemePanel.label,Visemes,バイセム,립싱크(Visemes)
VisemePanel.error.noMesh,No meshes found!,メッシュが見つかりません!,메쉬가 발견되지 않음!
BoneRootPanel.label,Bone Parenting,ボーンの子育て,본 부모설정
Av3EyeTrackingPanel.info1,Eye tracking is set up in Unity,Unityでアイトラッキングを設定する,시선 추적은 Unity에서 설정됩니다.
Av3EyeTrackingPanel.info2,Rotate eyes up to simplify setup,目を上に回転させてセットアップを簡素化,눈을 위로 회전시켜 설정을 단순화하세요
Av3EyeTrackingPanel.info1,Eye Tracking for VRChat SDK3,VRChat SDK3用のアイトラッキング,VRChat SDK3용 시선 추적
Av3EyeTrackingPanel.info2,is now setup in Unity this will,は Unity でセットアップされています。これにより、,이제는 Unity에서 설정됩니다.
Av3EyeTrackingPanel.info3,Rotate eyes up to simplify setup,目を上に回転させてセットアップを簡素化,눈을 위로 회전시켜 설정을 단순화하세요
Av3EyeTrackingRotateEyeBones.label,Rotate eye bones,目のボーンを回転させる,눈 뼈를 회전
Av3EyeTrackingRotateEyeBones.desc,Rotate eye bones to point straight up with zero roll. This simplifies setting up VRChat Avatars 3.0 eye tracking in Unity,目のボーンを回転させて、ロールをゼロにして真っ直ぐ上を向くようにします。これにより、Unity での VRChat Avatars 3.0 アイトラッキングのセットアップが簡素化されます.,롤이 0인 상태에서 눈 뼈가 똑바로 위를 향하도록 회전합니다. 이는 Unity에서 VRChat Avatars 3.0 시선 추적 설정을 단순화합니다.
Av3EyeTrackingRotateEyeBones.poll.noBones,No bones,骨がない,뼈가 없다
Av3EyeTrackingRotateEyeBones.poll.notInCurrentEditMode,"{armature} is not in the current Edit mode, either exit the current Edit mode or open {armature} in Edit mode","{armature} は現在の編集モードではありません。現在の編集モードを終了するか、編集モードで {armature} を開いてください.","{armature}가 현재 편집 모드에 있지 않습니다. 현재 편집 모드를 종료하거나 편집 모드에서 {armature}를 엽니다."
Av3EyeTrackingRotateEyeBones.info.noChanges,"Eye bones are already rotated for VRChat, no changes were made.","目のボーンは VRChat 用にすでに回転されており、変更は加えられません.","VRChat에서는 눈 뼈가 이미 회전되어 있어 변경 사항이 없습니다."
Av3EyeTrackingRotateEyeBones.success,Eye bones rotated.,目の骨が回転しました.,눈뼈가 회전했습니다.
LegacyEyeTrackingPanel.info1,This is the legacy Eye Tracking setup,これはレガシーな Eye Tracking のセットアップです,이것은 레거시 시선 추적 설정
LegacyEyeTrackingPanel.info2,this should NOT be used for VRChat as,この設定は VRChat で使用しないでください,이것은 VRChat에서 사용하지 말아야 합니다.
LegacyEyeTrackingPanel.info3,as eye tracking for VRChat is set up,VRChat のアイトラッキングは,VRChat의 시선 추적은
LegacyEyeTrackingPanel.info4,in Unity. This is for other games that,in Unity で設定されます。これは他のゲームで使用されます。,Unity에서 설정됩니다. 이것은 다른 게임에서 사용됩니다.
LegacyEyeTrackingPanel.info5,that need this system still like ChilloutVR.,そのためにこのシステムが必要です。,그러나 이 시스템은 ChilloutVR과 같은 게임에서
Scene.eye_left.label,Left Eye,左目,왼쪽 눈
Scene.eye_left.desc,The models left eye bone,,
Scene.eye_right.label,Right Eye,右目,오른쪽 눈
Expand Down Expand Up @@ -663,6 +669,50 @@ This helps with transparency and compatibility issues.

The converted image files will be saved next to the old ones",,
ConvertAllToPngButton.success,Converted {number} to PNG files.,,
CreateEyesButton.label,Create Eye Tracking,アイトラッキングを作成する,눈 추적(Eye Tracking) 생성
CreateEyesButton.desc,"This will let you track someone when they come close to you and it enables blinking.
You should do decimation before this operation.
Test the resulting eye movement in the 'Testing' tab.
DO NOT USE FOR VRCHAT SDK3 AVATARS",,"누군가가 가까이 왔을 때 그 사람을 추적 할 수 있고 눈 깜박임을 가능하게합니다.
데시메이션이 필요하다면 이 작업 이전에 해야합니다.
눈 움직임을 'Testing' 탭에서 테스트하세요."
CreateEyesButton.error.noShapeSelected,"You have no shape keys selected.
Please choose a mesh containing shape keys or check ""Disable Eye Blinking"".",,"선택된 쉐이프키가 없습니다.
쉐이프키가 포함 된 메쉬를 선택하거나 ""눈 깜빡임 비활성화""에 체크하세요."
CreateEyesButton.error.missingBone,"The bone ""{bone}"" does not exist.",,
CreateEyesButton.error.noVertex,"The bone ""{bone}"" has no existing vertex group or no vertices assigned to it.
This might be because you selected the wrong mesh or the wrong bone.
Also make sure that the selected eye bones actually move the eyes in pose mode.",,
CreateEyesButton.error.dontUse,"Please do not use ""{eyeName}"" as the input bone.
If you are sure that you want to use that bone please rename it to ""{eyeNameShort}"".",,
CreateEyesButton.error.hierarchy,"Eye tracking will not work unless the bone hierarchy is exactly as following: Hips > Spine > Chest > Neck > Head
Furthermore the mesh containing the eyes has to be called ""Body"" and the armature ""Armature"".",,
CreateEyesButton.success,Created eye tracking!,,
StartTestingButton.label,Start Eye Testing,スタートアイテスト,눈 움직임 테스트 시작
StartTestingButton.desc,"This will let you test how the eye movement will look ingame.
Don't forget to stop the Testing process afterwards.
Bones ""LeftEye"" and ""RightEye"" are required.",,
StopTestingButton.label,Stop Eye Testing,ストップアイテスト,눈 움직임 테스트 중지
StopTestingButton.desc,Stops the testing process.,,
StopTestingButton.error.tryAgain,Something went wrong. Please try eye testing again.,,
ResetRotationButton.label,Reset Rotation,回転をリセットする,회전 초기화
ResetRotationButton.desc,This resets the eye positions.,,
AdjustEyesButton.label,Set Range,目の範囲を設定,범위 설정
AdjustEyesButton.desc,"Lets you re-adjust the movement range of the eyes.
This gets saved",,
AdjustEyesButton.error.noVertex,"The bone ""{bone}"" has no existing vertex group or no vertices assigned to it.
This might be because you selected the wrong mesh or the wrong bone.
Also make sure to join your meshes before creating eye tracking and make sure that the eye bones actually move the eyes in pose mode.",,
StartIrisHeightButton.label,Start Iris Height Adjustment,アイリスの高さの調整を開始,눈동자 높이 조정 시작
StartIrisHeightButton.desc,"Lets you readjust the distance of the iris from the eye ball.
Use this to fix clipping of the iris into the eye ball.
This gets saved.",,
TestBlinking.label,Test,テスト,테스트
TestBlinking.desc,This lets you see how eye blinking will look in-game.,,게임 중에 눈 깜박임이 어떻게 보이는 지 확인할 수 있습니다.
TestLowerlid.label,Test,テスト,테스트
TestLowerlid.desc,This lets you see how lowerlids will look in-game.,,게임 중에 아래 눈꺼풀이 어떻게 보이는 지 확인할 수 있습니다.
ResetBlinkTest.label,Reset Shapes,図形をリセットする,쉐이프 초기화
ResetBlinkTest.desc,This resets the blink testing.,,눈깜빡임 테스트를 초기화한다.
RootButton.label,Parent Bones,親のボーンに接続する,부모 본
RootButton.desc,"This will duplicate the parent of the bones and reparent them to the duplicate.
Very useful for Dynamic Bones.",,
Expand Down Expand Up @@ -729,6 +779,56 @@ It will generate 15 shape keys from the 3 shape keys you specify",,"당신의
AutoVisemeButton.error.noShapekeys,This mesh has no shapekeys!,,이 메쉬는 쉐이프키가 없습니다!
AutoVisemeButton.error.selectShapekeys,"Please select the correct mouth shapekeys instead of ""Basis""!",,"""Basis"" 대신에 올바른 입모양 쉐이프키들을 선택하여 주세요!"
AutoVisemeButton.success,Created mouth visemes!,,입모양 쉐이프키들을 생성했습니다!
Scene.eye_mode.label,Eye Mode,アイモード,
Scene.eye_mode.desc,Mode,,
Scene.eye_mode.creation.label,Creation,創作,생성
Scene.eye_mode.creation.desc,Here you can create eye tracking.,,
Scene.eye_mode.testing.label,Testing,テスティング,테스트
Scene.eye_mode.testing.desc,Here you can test how eye tracking will look in-game.,,
Scene.mesh_name_eye.label,Mesh,メッシュ,메쉬
Scene.mesh_name_eye.desc,The mesh with the eyes vertex groups,,
Scene.head.label,Head,頭,머리
Scene.head.desc,The head bone containing the eye bones,,
Scene.eye_left.label,Left Eye,左目,왼쪽 눈
Scene.eye_left.desc,The models left eye bone,,
Scene.eye_right.label,Right Eye,右目,오른쪽 눈
Scene.eye_right.desc,The models right eye bone,,
Scene.wink_left.label,Blink Left,左点滅,왼쪽 깜빡임
Scene.wink_left.desc,The shape key containing a blink with the left eye,,
Scene.wink_right.label,Blink Right,右点滅,오른쪽 깜빡임
Scene.wink_right.desc,The shape key containing a blink with the right eye,,
Scene.lowerlid_left.label,Lowerlid Left,下まぶた左,왼쪽 아래 눈꺼풀
Scene.lowerlid_left.desc,"The shape key containing a slightly raised left lower lid.
Can be set to ""Basis"" to disable lower lid movement",,
Scene.lowerlid_right.label,Lowerlid Right,下まぶた右,오른쪽 아래 눈꺼풀
Scene.lowerlid_right.desc,"The shape key containing a slightly raised right lower lid.
Can be set to ""Basis"" to disable lower lid movement",,
Scene.disable_eye_movement.label,Disable Eye Movement,目の動きを無効にする,눈 움직임 비활성화
Scene.disable_eye_movement.desc,"IMPORTANT: Do your decimation first if you check this!

Disables eye movement. Useful if you only want blinking.
This creates eye bones with no movement bound to them.
You still have to assign ""LeftEye"" and ""RightEye"" to the eyes in Unity",,
Scene.disable_eye_blinking.label,Disable Eye Blinking,瞬きを無効にする,눈 깜빡임 비활성화
Scene.disable_eye_blinking.desc,"Disables eye blinking. Useful if you only want eye movement.
This will create the necessary shape keys but leaves them empty",,
Scene.eye_distance.label,Eye Movement Range,眼球運動範囲,눈 움직임 범위
Scene.eye_distance.desc,"Higher = more eye movement
Lower = less eye movement
Warning: Too little or too much range can glitch the eyes.
Test your results in the ""Eye Testing""-Tab!
",,
Scene.eye_rotation_x.label,Up - Down,上 - 下,위 - 아래
Scene.eye_rotation_x.desc,Rotate the eye bones on the vertical axis,,
Scene.eye_rotation_y.label,Left - Right,左 - 右,왼쪽 - 오른쪽
Scene.eye_rotation_y.desc,"Rotate the eye bones on the horizontal axis.
This is from your own point of view",,
Scene.iris_height.label,Iris Height,アイリスの高さ,눈동자 높이
Scene.iris_height.desc,Moves the iris away from the eye ball,,
Scene.eye_blink_shape.label,Blink Strength,まばたきの強さ,깜빡임 강도
Scene.eye_blink_shape.desc,Test the blinking of the eye,,
Scene.eye_lowerlid_shape.label,Lowerlid Strength,下まぶたの強さ,아래 눈꺼풀 강도
Scene.eye_lowerlid_shape.desc,Test the lowerlid blinking of the eye,,
Scene.armature.label,Armature,アーマチュア,뼈대(Armature)
Scene.armature.desc,Select the armature which will be used by Cats,,Cats에서 쓰여질 뼈대(Armature)를 선택해주세요.
Scene.zip_content.label,Zip Content,コンテンツを圧縮する,Zip 내용물
Expand Down Expand Up @@ -1007,6 +1107,8 @@ Scene.use_custom_mmd_tools.label,Use Custom mmd_tools,カスタムmmd_toolsを
Scene.use_custom_mmd_tools.desc,Enable this to use your own version of mmd_tools. This will disable the internal cats mmd_tools,,
Scene.debug_translations.label,Debug Google Translations,Google翻訳をデバッグ,Google 번역 디버그
Scene.debug_translations.desc,Tests the Google Translations and prints the Google response in case of error,,
Scene.shapekeycsv.label,Export Shape Keys Translations CSV,シェイプキー翻訳CSVをエクスポート,쉐이프키 번역 CSV 내보내기
Scene.shapekeycsv.desc,"When checked CATS will export shape keys translations to a CSV file located in Documents - cats - shapekeys.csv","チェックすると、CATS はシェイプ キーの翻訳をドキュメント - cats - Shapekeys.csv にある CSV ファイルにエクスポートします。","선택하면 CATS가 모양 키 번역을 문서 - cats - Shapekeys.csv에 있는 CSV 파일로 내보냅니다"
CheckForUpdateButton.label,Check now for Update,今すぐアップデートを確認,업데이트 체크
CheckForUpdateButton.desc,Checks if a new update is available for CATS,,
UpdateToLatestButton.label,Update Now,今すぐアップデート,지금 업데이트
Expand Down
23 changes: 1 addition & 22 deletions tools/armature.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ def execute(self, context):
except TypeError:
print('Color Management View Transform "Standard" not found!')

# Set shading to 3D view
set_material_shading()

# Remove Rigidbodies and joints
if context.scene.remove_rigidbodies_joints:
to_delete = []
Expand Down Expand Up @@ -322,10 +319,6 @@ def execute(self, context):

Common.sort_shape_keys(mesh.name, shapekey_order)


# Clean material names. Combining mats would do this too
Common.clean_material_names(mesh)

# Remove empty shape keys and then save the shape key order
Common.clean_shapekeys(mesh)
Common.save_shapekey_order(mesh.name)
Expand Down Expand Up @@ -1163,7 +1156,7 @@ def add_eye_children(eye_bone, parent_name):
if not source_engine:
try:
bpy.ops.mmd_tools_local.set_shadeless_glsl_shading()
set_material_shading()
Common.set_material_shading()
except RuntimeError:
pass

Expand Down Expand Up @@ -1236,17 +1229,3 @@ def check_hierarchy(check_parenting, correct_hierarchy_array):
return {'result': False, 'message': bone.name + t('FixArmature.notParentTo1') + previous + t('FixArmature.notParentTo2')}

return {'result': True}


def set_material_shading():
# Set shading to 3D view
for area in bpy.context.screen.areas: # iterate through areas in current screen
if area.type == 'VIEW_3D':
for space in area.spaces: # iterate through spaces in current VIEW_3D area
if space.type == 'VIEW_3D': # check if space is a 3D view
space.shading.type = 'MATERIAL' # set the viewport shading to rendered
space.shading.studio_light = 'forest.exr'
space.shading.studiolight_rotate_z = 0.0
space.shading.studiolight_background_alpha = 0.0
if bpy.app.version >= (2, 82):
space.shading.render_pass = 'COMBINED'
Loading

0 comments on commit 8a954b5

Please sign in to comment.