This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 関連するボーンが存在しない剛体を削除する | |
// [簡易形式]DeleteUnlinkedBodies.cx | |
// | |
for (int i = body.Count - 1; i >= 0; i--) | |
{ | |
if (body[i].Bone == null) // 関連するボーンが存在しない | |
{ | |
body.RemoveAt(i); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 指定した名前が含まれるボーンを削除する | |
// [簡易形式]DeleteSpecifiedBones.cx | |
// | |
string name = "スカート"; // ボーン名(一部) | |
for (int i = bone.Count - 1; i >= 0; i--) | |
{ | |
if (bone[i].Name.IndexOf(name) >= 0) | |
{ | |
bone.RemoveAt(i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// pmdの材質名リストを読み込む | |
// [簡易形式]LoadMaterialNames.cx | |
// | |
// pmdデータと同じフォルダにある txt ファイル | |
string materiallist = string.Format(@"{0}\{1}.txt", Path.GetDirectoryName(pmx.FilePath), Path.GetFileNameWithoutExtension(pmx.FilePath)); | |
// 材質名リストを一行ずつ読み込んでセットする | |
using (StreamReader reader = new StreamReader(materiallist, System.Text.Encoding.Default)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
doc = MQSystem.getDocument() | |
curidx = doc.currentObjectIndex | |
if curidx != -1: | |
obj = doc.object[curidx] | |
if not (obj is None): | |
mtx = doc.getGlobalInverseMatrix(obj) | |
# show vertices | |
numVert = obj.numVertex |
NewerOlder