我想使用3dsmax python api来获取骨骼模式的顶点权重骨骼计数如下:
from pymxs import runtime as rt
import MaxPlus
max_root = MaxPlus.Core.GetRootNode()
#get the mesh node
mesh_node = max_root.GetChild(0)
#there is only one modifier the skin modifier
mod = mesh_node.GetModifier(0)
#get the first vertex weight count
weight_count = rt.skinOps.GetVertexWeightCount(mod, 0)
我得到了这个错误:
Unable to convert: Animatable(Skin) to type: Modifier.
有什么办法解决这个问题吗?
发布于 2019-06-13 23:24:50
你可以做的事情是:
from pymxs import runtime as rt
import MaxPlus
# Get the selected node (must be a mesh)
mesh_node = MaxPlus.SelectionManager.GetNodes()[0]
# Get the skin
skin = rt.getnodebyname(mesh_node.Name).skin
# Get the bone count
bone_count = rt.skinOps.GetNumberBones(skin)
print(bone_count)
# Get the first vertex weight count
weight_count = rt.skinOps.GetVertexWeightCount(skin, 1)
print(weight_count)
我希望它能帮助任何读到这一页的人。
发布于 2018-06-19 14:41:02
您不能以这种方式组合MAXScript和MaxPlus,一个是pymx运行时引擎,另一个是C++ SDK和本机对象的包装器。我的意思是,你可以传递指针和句柄,并将对象与这些对象相互转换,但只坚持其中之一要容易得多。
https://stackoverflow.com/questions/50919654
复制相似问题