https://vimeo.com/697820338
JiapeiShowcase_2022.mp4 from Jiapei Lu on Vimeo.
I have been a 3D animator in game industry for over a decade. I also interested in script and love to solving problems. Now I am learning how to write plugin.
https://vimeo.com/697820338
JiapeiShowcase_2022.mp4 from Jiapei Lu on Vimeo.
發生問題:
在mobu 2020利用os 連接路徑報錯,發現以Json.load()的字典格式,為unicode
而mobu無法辨識,需先將用到字串利用string.encode('utf-8')
才能使用
後來想想覺得應是在open()時,就可以先轉換,就不用對個案一個一個轉換
在網路查了相關的關鍵字"python2.x, json.load, dict, unicode, utf-8, open"
試了多個覺得可行的方式
像是open加入encoding
或是json.dump()加入encoding
import io
都沒什麼用
最後找到這個解最簡單,原網址https://www.jianshu.com/p/90ecc5987a18
def Read_Dict_Data( Dict_Data ):
import json
def byteify(input, encoding='utf-8'):
if isinstance(input, dict):
return {byteify(key): byteify(value) for key, value in input.iteritems()}
elif isinstance(input, list):
return [byteify(element) for element in input]
elif isinstance(input, unicode):
return input.encode(encoding)
else:
return input
with open ( Dict_Data )as f:
data = json.load(f, encoding = 'UTF-8')# it is useless adding encoding when use json.load()
return byteify(data) 如果是Python3就沒有以上問題
多數網頁都沒清楚的說明python2與3的差別,所以記錄一下
Tpose Tool Story:
Do you fell it is annoyed to pose a t-pose when do HIK setup? If you do, Try this tool which can rotate selected bones to vertical or horizontal angle depending on its origal angle.
You can download the tool from HERE
工具介紹
如果你跟我一樣在設定Tpose時,覺得手動調很煩,可以試試這個小工具
選擇要水平或垂直的骨骼,執行工具,就會自動判定接近的角度。
以影片的角色為例,因為上手臂較接近垂直線,所以先手動調整到接近水平後
再執行工具,就可以快速得到對的角度!
Maya 2022 已改用python3 很多工具都需要轉換
This tool is for matching vertex position and normal from Act vertex to Ref vertex.
It needs numpy.
To install numpy, navigate to maya app directory (which looks like “C:\Program Files\Autodesk\Maya2023\bin”)
inside folder shift and right click mouse. choose open power shell cmd prompt, type
mayapy.exe -m pip install ‐‐user numpy
or
.\mayapy.exe -m pip install ‐‐user numpy
Click Download
Usage:
import vtxMatch
from importlib import reload
reload(vtxMatch)