首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用3dsmax python api获取顶点权重骨骼计数

使用3dsmax python api获取顶点权重骨骼计数
EN

Stack Overflow用户
提问于 2018-06-19 09:59:21
回答 2查看 521关注 0票数 0

我想使用3dsmax python api来获取骨骼模式的顶点权重骨骼计数如下:

代码语言:javascript
运行
复制
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)

我得到了这个错误:

代码语言:javascript
运行
复制
Unable to convert: Animatable(Skin) to type: Modifier.

有什么办法解决这个问题吗?

EN

回答 2

Stack Overflow用户

发布于 2019-06-13 23:24:50

你可以做的事情是:

代码语言:javascript
运行
复制
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)

我希望它能帮助任何读到这一页的人。

票数 1
EN

Stack Overflow用户

发布于 2018-06-19 14:41:02

您不能以这种方式组合MAXScript和MaxPlus,一个是pymx运行时引擎,另一个是C++ SDK和本机对象的包装器。我的意思是,你可以传递指针和句柄,并将对象与这些对象相互转换,但只坚持其中之一要容易得多。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50919654

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档