Skip to content

Commit

Permalink
Update to 1.4.1
Browse files Browse the repository at this point in the history
Update to 1.4.1
  • Loading branch information
Darkblader24 authored Jan 13, 2023
2 parents 3613686 + 552400c commit e9bd129
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 67 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This plugin lets you stream your animation data from Rokoko Studio directly into
- Easily retarget motion capture animations

## Installation
- Download the latest version [here](https://github.com/Rokoko/rokoko-studio-live-blender/archive/refs/heads/master.zip)
- **Download the latest version [here](https://github.com/Rokoko/rokoko-studio-live-blender/archive/refs/heads/master.zip)**
- In Blender go to Edit > Preferences > Addons > Install.. and then select the downloaded zip file
- First time installation can take a while
- To use the plugin, press N and select the Rokoko panel
Expand Down Expand Up @@ -112,6 +112,10 @@ In order to retarget an animation in Blender you will need to do the following:

## Changelog

#### 1.4.1
- Added support for Blender 3.4
- Fixed multiple smaller issues

#### 1.4.0
- Added support for Blender 3.0/3.1 and Rokoko Studio 2
- Fully reworked login
Expand Down
10 changes: 7 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
'category': 'Animation',
'location': 'View 3D > Tool Shelf > Rokoko',
'description': 'Stream your Rokoko Studio animations directly into Blender',
'version': (1, 4, 0),
'version': (1, 4, 1),
'blender': (2, 80, 0),
'wiki_url': 'https://rokoko.freshdesk.com/support/solutions/folders/47000761699',
'wiki_url': 'https://github.com/Rokoko/rokoko-studio-live-blender#readme',
}

beta_branch = False
Expand Down Expand Up @@ -75,13 +75,15 @@ def install_libraries(self, required):
# Install the missing libraries into the library path
print("Installing missing libraries:", missing)
try:
# command = [self.python, '-m', 'pip', 'install', f"--target={str(self.libs_dir)}", "--index-url=http://pypi.python.org/simple/", "--trusted-host=pypi.python.org", *missing]
command = [self.python, '-m', 'pip', 'install', f"--target={str(self.libs_dir)}", *missing]
subprocess.check_call(command, stdout=subprocess.DEVNULL)
except subprocess.CalledProcessError as e:
print("PIP Error:", e)
print("Installing libraries failed.")
if self.os_name != "Windows":
print("Retrying with sudo..")
# command = ["sudo", self.python, '-m', 'pip', 'install', f"--target={str(self.libs_dir)}", "--index-url=http://pypi.python.org/simple/", "--trusted-host=pypi.python.org", *missing]
command = ["sudo", self.python, '-m', 'pip', 'install', f"--target={str(self.libs_dir)}", *missing]
subprocess.call(command, stdout=subprocess.DEVNULL)
finally:
Expand Down Expand Up @@ -144,12 +146,14 @@ def _update_pip(self):

print("Updating pip")
try:
# subprocess.check_call([self.python, "-m", "pip", "install", "--upgrade", "--index-url=http://pypi.python.org/simple/", "--trusted-host=pypi.python.org", "pip"])
subprocess.check_call([self.python, "-m", "pip", "install", "--upgrade", "pip"])
except subprocess.CalledProcessError as e:
print("PIP Error:", e)
print("Updating pip failed.")
if self.os_name != "Windows":
print("Retrying with sudo..")
# subprocess.call(["sudo", self.python, "-m", "pip", "install", "--upgrade", "--index-url=http://pypi.python.org/simple/", "--trusted-host=pypi.python.org", "pip"])
subprocess.call(["sudo", self.python, "-m", "pip", "install", "--upgrade", "pip"])
finally:
# Reset console color, because it could still be colored after running pip
Expand Down Expand Up @@ -312,7 +316,7 @@ def register_late():

# Check if the user is logged in, show the login panel if not
# logged_in = core.login.login_from_cache(classes, classes_login)
logged_in = core.login_manager.user.auto_login(classes, classes_login)
logged_in = core.login_manager.user.auto_login(classes, classes_login, bl_info)

# Register classes
# The classes need to be assigned as list() to create a duplicate
Expand Down
14 changes: 9 additions & 5 deletions core/animations.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ def animate_actor(obj):
bone_data = obj.data.bones.get(bone_name_assigned)
bone_tpose_data = tpose_bones.get(bone_name_assigned)

actor_bone_data = actor[bone_name] if live_data.version <= 2 else actor['body'][bone_name]
try:
actor_bone_data = actor[bone_name] if live_data.version <= 2 else actor['body'][bone_name]
except KeyError:
print('Bone not found in live data:', bone_name)
continue

# Skip if there is no bone assigned to this live data or if there is no tpose data for this bone
if not bone or not bone_tpose_data:
Expand All @@ -137,10 +141,10 @@ def animate_actor(obj):

# The new pose in which the bone should be (still in Studio space)
studio_new_pose = Quaternion((
actor_bone_data['rotation']['w'],
actor_bone_data['rotation']['x'],
actor_bone_data['rotation']['y'],
actor_bone_data['rotation']['z'],
float(actor_bone_data['rotation']['w']),
float(actor_bone_data['rotation']['x']),
float(actor_bone_data['rotation']['y']),
float(actor_bone_data['rotation']['z']),
))

# Function to convert from Studio to Blender space
Expand Down
15 changes: 15 additions & 0 deletions core/auto_detect_lists/bones.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@
'Arm_\L_Finger_1a',
'J_Oya_A_\L',
'\LFinger1Metacarpal',
'Mixamorig:\LHandThumb1',
]
bone_list['leftThumbMedial'] = [
'Thumb1_\L',
Expand Down Expand Up @@ -679,6 +680,7 @@
'Arm_\L_Finger_1b',
'J_Oya_B_\L',
'\LFinger1Proximal',
'Mixamorig:\LHandThumb2',
]
bone_list['leftThumbDistal'] = [
'Thumb2_\L',
Expand Down Expand Up @@ -711,6 +713,7 @@
'Arm_\L_Finger_1c',
'J_Oya_C_\L',
'\LFinger1Distal',
'Mixamorig:\LHandThumb3',
]
bone_list['leftIndexProximal'] = [
'IndexFinger1_\L',
Expand Down Expand Up @@ -746,6 +749,7 @@
'Arm_\L_Finger_2a',
'J_Hito_A_\L',
'\LFinger2Proximal',
'Mixamorig:\LHandIndex1',
]
bone_list['leftIndexMedial'] = [
'IndexFinger2_\L',
Expand Down Expand Up @@ -781,6 +785,7 @@
'Arm_\L_Finger_2b',
'J_Hito_B_\L',
'\LFinger2Medial',
'Mixamorig:\LHandIndex2',
]
bone_list['leftIndexDistal'] = [
'IndexFinger3_\L',
Expand Down Expand Up @@ -817,6 +822,7 @@
'Arm_\L_Finger_2c',
'J_Hito_C_\L',
'\LFinger2Distal',
'Mixamorig:\LHandIndex3',
]
bone_list['leftMiddleProximal'] = [
'MiddleFinger1_\L',
Expand Down Expand Up @@ -853,6 +859,7 @@
'Arm_\L_Finger_3a',
'J_Naka_A_\L',
'\LFinger3Proximal',
'Mixamorig:\LHandMiddle1',
]
bone_list['leftMiddleMedial'] = [
'MiddleFinger2_\L',
Expand Down Expand Up @@ -888,6 +895,7 @@
'Arm_\L_Finger_3b',
'J_Naka_B_\L',
'\LFinger3Medial',
'Mixamorig:\LHandMiddle2',
]
bone_list['leftMiddleDistal'] = [
'MiddleFinger3_\L',
Expand Down Expand Up @@ -923,6 +931,7 @@
'Arm_\L_Finger_3c',
'J_Naka_C_\L',
'\LFinger3Distal',
'Mixamorig:\LHandMiddle3',
]
bone_list['leftRingProximal'] = [
'RingFinger1_\L',
Expand Down Expand Up @@ -959,6 +968,7 @@
'Arm_\L_Finger_4a',
'J_Kusu_A_\L',
'\LFinger4Proximal',
'Mixamorig:\LHandRing1',
]
bone_list['leftRingMedial'] = [
'RingFinger2_\L',
Expand Down Expand Up @@ -995,6 +1005,7 @@
'Arm_\L_Finger_4b',
'J_Kusu_B_\L',
'\LFinger4Medial',
'Mixamorig:\LHandRing2',
]
bone_list['leftRingDistal'] = [
'RingFinger3_\L',
Expand Down Expand Up @@ -1031,6 +1042,7 @@
'Arm_\L_Finger_4c',
'J_Kusu_C_\L',
'\LFinger4Distal',
'Mixamorig:\LHandRing3',
]
bone_list['leftLittleProximal'] = [
'LittleFinger1_\L',
Expand Down Expand Up @@ -1068,6 +1080,7 @@
'Arm_\L_Finger_5a',
'J_Ko_A_\L',
'\LFinger5Proximal',
'Mixamorig:\LHandPinky1',
]
bone_list['leftLittleMedial'] = [
'LittleFinger2_\L',
Expand Down Expand Up @@ -1105,6 +1118,7 @@
'Arm_\L_Finger_5b',
'J_Ko_B_\L',
'\LFinger5Medial',
'Mixamorig:\LHandPinky2',
]
bone_list['leftLittleDistal'] = [
'LittleFinger3_\L',
Expand Down Expand Up @@ -1142,4 +1156,5 @@
'Arm_\L_Finger_5c',
'J_Ko_C_\L',
'\LFinger5Distal',
'Mixamorig:\LHandPinky3',
]
4 changes: 2 additions & 2 deletions core/live_data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ def get_actor_id(self, actor):
return actor['name']

def get_face_by_obj(self, obj):
face_id = 'faceId' # if self.version <= 2 else 'parentName'
face_id = 'faceId' if self.version <= 2 else 'parentName'
faces = [face for face in self.faces if face[face_id] == obj.rsl_animations_faces]
return faces[0] if faces else None

def get_face_id(self, face):
face_id = 'faceId' # if self.version <= 2 else 'parentName'
face_id = 'faceId' if self.version <= 2 else 'parentName'
return face[face_id]

def get_face_parent_id(self, face):
Expand Down
Loading

0 comments on commit e9bd129

Please sign in to comment.