I just want to write a function to get bonelist of skin modifier. But I’m not sure how I can return array of nodes.
#include "bonesdef.h"
#include <maxscript/maxscript.h>
#include <maxscript/maxwrapper/mxsobjects.h>
#include <maxscript/macros/define_instantiation_functions.h>
def_visible_primitive(Skin_GetBoneList, "Skin_GetBoneList");
Value* Skin_GetBoneList_cf(Value **arg_list, int count)
{
check_arg_count(Skin_GetBoneList, 1, count);
BonesDefMod* bmod = (BonesDefMod*)(arg_list[0]);
Array * boneList = new Array(bmod->BoneData.Count());
for (size_t i = 0; i < bmod->BoneData.Count(); i++)
{
boneList->append((Value*)bmod->BoneData[i].Node);
}
one_typed_value_local(Array* result);
vl.result = boneList;
return_value(vl.result);
}
… you have a modifier that implements the ISkin interface use that to access the bones.