first commit
This commit is contained in:
164
miapia_own/FemAdv_b350_V2_050523.py
Normal file
164
miapia_own/FemAdv_b350_V2_050523.py
Normal file
@@ -0,0 +1,164 @@
|
||||
import random
|
||||
import shutil
|
||||
|
||||
model_bsList = ["browDownLeft",
|
||||
"browDownRight",
|
||||
"browInnerUp",
|
||||
"browOuterUpLeft",
|
||||
"browOuterUpRight",
|
||||
"cheekPuff",
|
||||
"cheekSquintLeft",
|
||||
"cheekSquintRight",
|
||||
"eyeBlinkLeft",
|
||||
"eyeBlinkRight",
|
||||
"eyeLookDownLeft",
|
||||
"eyeLookDownRight",
|
||||
"eyeLookInLeft",
|
||||
"eyeLookInRight",
|
||||
"eyeLookOutLeft",
|
||||
"eyeLookOutRight",
|
||||
"eyeLookUpLeft",
|
||||
"eyeLookUpRight",
|
||||
"eyeSquintLeft",
|
||||
"eyeSquintRight",
|
||||
"eyeWideLeft",
|
||||
"eyeWideRight",
|
||||
"jawForward",
|
||||
"jawLeft",
|
||||
"jawOpen",
|
||||
"jawRight",
|
||||
"mouthClose",
|
||||
"mouthDimpleLeft",
|
||||
"mouthDimpleRight",
|
||||
"mouthFrownLeft",
|
||||
"mouthFrownRight",
|
||||
"mouthFunnel",
|
||||
"mouthLeft",
|
||||
"mouthLowerDownLeft",
|
||||
"mouthLowerDownRight",
|
||||
"mouthPressLeft",
|
||||
"mouthPressRight",
|
||||
"mouthPucker",
|
||||
"mouthRight",
|
||||
"mouthRollLower",
|
||||
"mouthRollUpper",
|
||||
"mouthShrugLower",
|
||||
"mouthShrugUpper",
|
||||
"mouthSmileLeft",
|
||||
"mouthSmileRight",
|
||||
"mouthStretchLeft",
|
||||
"mouthStretchRight",
|
||||
"mouthUpperUpLeft",
|
||||
"mouthUpperUpRight",
|
||||
"noseSneerLeft",
|
||||
"noseSneerRight",
|
||||
"tongueOut"]
|
||||
|
||||
import bpy
|
||||
import os
|
||||
import numpy as np
|
||||
import sys
|
||||
|
||||
filename = str(sys.argv[-1])
|
||||
root_dir = str(sys.argv[-2])
|
||||
|
||||
object_name = "MFA_body"
|
||||
obj = bpy.data.objects[object_name]
|
||||
|
||||
bpy.context.scene.render.engine = 'BLENDER_WORKBENCH'
|
||||
bpy.context.scene.display.shading.light = 'MATCAP'
|
||||
bpy.context.scene.display.render_aa = 'FXAA'
|
||||
bpy.context.scene.render.resolution_x = int(512)
|
||||
bpy.context.scene.render.resolution_y = int(768)
|
||||
bpy.context.scene.render.fps = 30
|
||||
bpy.context.scene.render.image_settings.file_format = 'PNG'
|
||||
|
||||
cam = bpy.data.objects['0Camera']
|
||||
cam.scale = [2, 2, 2]
|
||||
bpy.context.scene.camera = cam
|
||||
|
||||
"""
|
||||
model_bsList = ['Basis',
|
||||
'0',
|
||||
'X_postrig',
|
||||
'X_neck',
|
||||
'X_head',
|
||||
'X_eyesfix',
|
||||
'X_breast',
|
||||
'X_nails',
|
||||
'X_pus_conf.1',
|
||||
'X_pus_assym', 'X_jadafication',
|
||||
'X_facetweak', 'X_eyeshape',
|
||||
'A_nipple_in', 'A_nailsmax',
|
||||
'A_pregnant', 'PAD_breathe',
|
||||
'PAD_swallow', 'Head',
|
||||
'cr_neck1', 'cr_neck2',
|
||||
'cr_neck3.R', 'cr_neck3.L',
|
||||
'cr_neck4.L', 'cr_neck4.R', 'cr_jaw1', 'cr_jaw2', 'sqz_jaw3', 'cr_brows_dwn', 'cr_brows_up',
|
||||
'cr_eye_lookdown', 'cr_eye_open',
|
||||
'cr_eye_look.L', 'cr_eye_look.R', 'cr_mouthmax.L', 'cr_mouthmax.R', 'cr_cheekin.L', 'cr_cheekin.R', 'Body', 'cr_spine',
|
||||
'cr_spine2', 'cr_spine3', 'cr_spine2.L',
|
||||
'cr_spine2.R', 'cr_spine4.L', 'cr_spine4.R',
|
||||
'cr_spine5.L', 'cr_spine5.R', 'cr_lowerspine.bcw',
|
||||
'cr_lowerspine.fwd', 'size_breastXL.L', 'size_breastXL.R',
|
||||
'size_breastXS.L', 'size_breastXS.R', 'size_oreola.L',
|
||||
'size_oreola.R', 'Legs', 'cr_hipout.L', 'cr_hipout.R',
|
||||
'cr_hipin.L', 'cr_hipin.R', 'cr_pussyflattern',
|
||||
'cr_hip0.L', 'cr_hip0.R', 'cr_hip1.L', 'cr_hip1.R',
|
||||
'cr_hip45.L', 'cr_hip45.R', 'sqz_hip1max.L',
|
||||
'sqz_hip1max.R', 'sqz_hip1vol.L', 'sqz_hip1vol.R',
|
||||
'sqz_hip1squeeze.L', 'sqz_hip1squeeze.R', 'cr_hip2.L',
|
||||
'cr_hip2.R', 'sqz_hip2.L', 'sqz_hip2.R', 'cr_hip3.L',
|
||||
'cr_hip3.R', 'sqz_buttrest.L', 'sqz_buttrest.R',
|
||||
'cr_knee45.L', 'cr_knee45.R', 'cr_knee.L', 'cr_knee.R',
|
||||
'sqz_knee.L', 'sqz_knee.R', 'sqz_stance.L', 'sqz_stance.R',
|
||||
'cr_buttheart.L', 'cr_buttheart.R', 'rest_buttcheek.L',
|
||||
'rest_buttcheek.R', 'rest_knee.L', 'rest_knee.R', 'rest_knee_fat.L',
|
||||
'rest_knee_fat.R', 'rest_hip.L', 'rest_hip.R', 'vol_butt.L',
|
||||
'vol_butt.R', 'Feet', 'cr_feet1.L', 'cr_feet1.R', 'cr_feet2.L',
|
||||
'cr_feet2.R', 'cr_feet3.L', 'cr_feet3.R', 'cr_toe1.L', 'cr_toe1.R',
|
||||
'cr_toe2.L', 'cr_toe2.R', 'Arms', 'cr_arm-up.L', 'cr_arm-up.R',
|
||||
'cr_arm-fwd.L', 'cr_arm-fwd.R', 'cr_arm-dwn.L', 'cr_arm-dwn.R',
|
||||
'sqz_arm-fwd.L', 'sqz_arm-fwd.R', 'sqz_armpit.L', 'sqz_armpit.R',
|
||||
'sqz_arm-bcw.L', 'sqz_arm-bcw.R', 'sqz_arm-bcw_max.L',
|
||||
'sqz_arm-bcw_max.R', 'cr_arm-trc.L', 'cr_arm-trc.R',
|
||||
'D_cr_elbow.L', 'U_cr_elbow.L', 'D_cr_elbow.R', 'U_cr_elbow.R',
|
||||
'D_sqz_elbowMax.L', 'U_sqz_elbowMax.L', 'D_sqz_elbowMax.R',
|
||||
'U_sqz_elbowMax.R', 'cr_armrest.L', 'cr_armrest.R',
|
||||
'cr_shoulder_fwd.L', 'cr_shoulder_fwd.R', 'cr_shoulder_bcw.L',
|
||||
'cr_shoulder_bcw.R', 'cr_shoulder_dwn.L', 'cr_shoulder_dwn.R',
|
||||
'cr_shoulder_up.L', 'cr_shoulder_up.R', 'rest_elbow.L', 'rest_elbow.R',
|
||||
'Hands', 'cr_hand1.L', 'cr_hand1.R',
|
||||
'cr_hand2.L', 'cr_hand2.R', 'cr_handtwistU.L', 'cr_handtwistU.R',
|
||||
'cr_handtwistD.L',
|
||||
'cr_handtwistD.R',
|
||||
'cr_thumb.01.L', 'cr_thumb.01.R',
|
||||
'cr_f_index.01.L', 'cr_f_index.01.R', 'cr_f_index.02.L',
|
||||
'cr_f_index.02.R',
|
||||
'cr_f_middle.01.L', 'cr_f_middle.01.R', 'cr_f_middle.02.L',
|
||||
'cr_f_middle.02.R', 'cr_f_ring.01.L', 'cr_f_ring.01.R',
|
||||
'cr_f_ring.02.L', 'cr_f_ring.02.R', 'cr_f_pinky.01.L',
|
||||
'cr_f_pinky.01.R', 'cr_f_pinky.02.L', 'cr_f_pinky.02.R', 'EM',
|
||||
'em_eye_close.L', 'em_eye_close.R', 'em_eye_half.L', 'em_eye_half.R',
|
||||
'em_smile_open', 'em_smile_close', 'em_kiss', 'em_disg', 'em_blow',
|
||||
'em_surprise', 'em_sad', 'em_frown', 'PH', 'ph_+', 'ph_bpm',
|
||||
'ph_fv', 'ph_ou',
|
||||
'ph_e', 'ph_r', 'ph_ch', 'ph_th', 'ph_a']"""
|
||||
|
||||
model_bsList = list(obj.data.shape_keys.key_blocks.keys())
|
||||
|
||||
|
||||
# print(obj.data.shape_keys.key_blocks.keys())
|
||||
|
||||
output_dir = root_dir + filename
|
||||
blendshape_path = root_dir + filename + '.npy'
|
||||
|
||||
result = []
|
||||
bs = np.load(blendshape_path)
|
||||
|
||||
for i in range(10):
|
||||
for kp_name in model_bsList:
|
||||
obj.data.shape_keys.key_blocks[kp_name].value = random.random()
|
||||
bpy.context.scene.render.filepath = os.path.join(output_dir,
|
||||
'{}.png'.format(i))
|
||||
bpy.ops.render.render(write_still=True)
|
||||
Reference in New Issue
Block a user