{"id":309,"date":"2013-07-14T22:20:38","date_gmt":"2013-07-14T13:20:38","guid":{"rendered":"http:\/\/humrevlife.com\/?p=309"},"modified":"2013-07-14T22:20:38","modified_gmt":"2013-07-14T13:20:38","slug":"mwp-motionbuilder-with-python%e3%80%80%e3%81%9d%e3%81%ae9%e3%80%80%e3%80%8cfbmarkerset%e3%81%abobject%e3%82%92%e7%99%bb%e9%8c%b2%e3%83%bb%e8%a7%a3%e9%99%a4%e3%81%99%e3%82%8b%e3%80%8d","status":"publish","type":"post","link":"https:\/\/humrevlife.com\/?p=309","title":{"rendered":"MWP (Motionbuilder With Python)\u3000\u305d\u306e9\u3000\u300cFBMarkerSet\u306bObject\u3092\u767b\u9332\u30fb\u89e3\u9664\u3059\u308b\u300d"},"content":{"rendered":"<p>\u4eca\u65e5\u306f<a title=\"MWP (Motionbuilder With Python)\u3000\u305d\u306e8\u3000\u300cFBActor\u306eMarkerSet\u3092\u8a2d\u5b9a\u3059\u308b\u300d\" href=\"http:\/\/humrevlife.com\/?p=266\">\u305d\u306e8<\/a>\u306e\u7d9a\u304d\u3067MarkerSet\u306bObject\u3092\u767b\u9332\u3059\u308b\u65b9\u6cd5\u306e\u304a\u8a71\u3002<\/p>\n<p>\u3084\u3070\u3044\u3001\u4e2d\u8eab\u6fc3\u3044\u3067\u3059\u3002\u3002\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 18px;\">\u25a0MarkerSet\u306bObject\u3092\u767b\u9332\u3059\u308b<\/span><\/strong><\/p>\n<p>[python]<br \/>\nfrom pyfbsdk import FBApplication,FBActor,FBMarkerSet,FBModelMarker,FBSkeletonNodeId<\/p>\n<p>lActor = FBApplication().CurrentActor<br \/>\nlMkSet = None<br \/>\nif not lActor:<br \/>\n    lActor = FBActor(&quot;mike&quot;)<br \/>\n    lMkset = FBMarkerSet(&quot;mike_Mkset&quot;)<br \/>\n    lActor.MarkerSet = lMkset<\/p>\n<p>if not lMkSet:<br \/>\n    lMkSet = lActor.MarkerSet<\/p>\n<p>#print FBSkeletonNodeId.names<br \/>\nfor enum in FBSkeletonNodeId.values:<br \/>\n    lSkelNode = FBSkeletonNodeId.values[enum]<br \/>\n    if &quot;Hips&quot; in lSkelNode.name:<br \/>\n        lObj = FBModelMarker(&quot;Hip&quot;)<br \/>\n        lMkSet.AddMarker(lSkelNode, lObj)<br \/>\n        print &quot;add %s to %s MarkerSet&quot;%(lObj.Name,lMkSet.Name)<\/p>\n<p>[\/python]<\/p>\n<p>FBMarkerSet\u306eAttribute\u306b\u306fAddMarker\u304c\u3042\u3063\u3066\u305d\u308c\u3092\u4f7f\u3063\u3066\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u5384\u4ecb\u306a\u306e\u304c\u7b2c\u4e00\u5f15\u6570\u306b<strong><span style=\"color: #ff0000;\">FBSkeletonNodeId<\/span><\/strong>\u306a\u308b\u3082\u306e\u3092\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u3053\u3068\u3002<\/p>\n<p>\u5b58\u5728\u3092\u77e5\u3063\u3066\u3044\u308b\u4eba\u306e\u307b\u3046\u304c\u5c11\u306a\u3044\u6c17\u304c\u3057\u307e\u3059\u304c\u3001<span style=\"font-size: 14px;\">\u30a2\u30af\u30bf\u30fc\u4eba\u5f62\u306e\u9aa8\u3092\u7ba1\u7406\u3057\u3066\u3044\u308benum(\u69cb\u9020\u4f53)\u3067\u3059\u3002<\/span><\/p>\n<p>FBSkeletonNodeId\u306eAttribute\u306b\u95a2\u3057\u3066\u306f13\u884c\u76ee\u306e\u30d7\u30ea\u30f3\u30c8\u3092\u5b9f\u884c\u3057\u3066\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u203b\u3053\u3053\u306b\u66f8\u304f\u3068\u898b\u306b\u304f\u3044\u4e8b\u3053\u306e\u4e0a\u306a\u3044\u72b6\u614b\u306b\u306a\u308b\u306e\u3067\u8a31\u3057\u3066\u304f\u3060\u3055\u3044<\/p>\n<p><strong>\u3053\u3053\u3067\u6ce8\u610f\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u304c\u80a9\u3001\u8098\u306eFBSkeletonNodeId\u306e\u30cd\u30fc\u30df\u30f3\u30b0\u304c\u4e00\u822c\u7684\u306a\u65e5\u672c\u4eba\u306e\u611f\u899a\u3068\u306f\u305a\u308c\u3066\u3044\u308b\u3068\u3053\u308d\u3002<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-312\" alt=\"09_MarkerSet_01\" src=\"http:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_01.jpg\" width=\"171\" height=\"225\" \/><\/a><\/p>\n<p>\u8a66\u3057\u306b\u5de6\u80a9\u306b\u767b\u9332\u3059\u308b\u3053\u3068\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u5de6\u80a9\u306a\u306e\u3067SDK\u3000Document\u3092\u53c2\u7167\u3059\u308b\u3068\u3001<\/p>\n<p>FBSkeletonNodeId.kFBSkeletonLeftShoulderIndex\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3068\u3044\u3046\u4e8b\u306f\u3053\u306eID\u3092\u4f7f\u3063\u3066\u30de\u30fc\u30ab\u30fc\u3092\u767b\u9332\u3059\u308b\u3068\u8003\u3048\u308b\u306e\u304c\u59a5\u5f53\u3067\u3059\u3088\u306d\uff1f<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u5b9f\u969b\u306b\u767b\u9332\u3057\u3066\u307f\u308b\u3068\u3002\u3002\u3002\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 18px;\">\u25a0MarkerSet\u306eLeftShoulder\u306b\u30de\u30fc\u30ab\u30fc\u3092\u767b\u9332\u3059\u308b\u3002<\/span><\/strong><\/p>\n<p>[python]<br \/>\nfrom pyfbsdk import FBApplication,FBActor,FBMarkerSet,FBModelMarker,FBSkeletonNodeId<\/p>\n<p>lActor = FBApplication().CurrentActor<br \/>\nlMkSet = None<br \/>\nif not lActor:<br \/>\n    lActor = FBActor(&quot;mike&quot;)<br \/>\n    lMkset = FBMarkerSet(&quot;mike_Mkset&quot;)<br \/>\n    lActor.MarkerSet = lMkset<\/p>\n<p>if not lMkSet:<br \/>\n    lMkSet = lActor.MarkerSet<\/p>\n<p>lObj = FBModelMarker(&quot;LeftShoulder&quot;)<br \/>\nlSkelNode = FBSkeletonNodeId.kFBSkeletonLeftShoulderIndex<br \/>\nlMkSet.AddMarker(lSkelNode, lObj)<br \/>\n[\/python]<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 18px;\">\u25a0\u7d50\u679c<\/span><\/strong><br \/>\n<a href=\"http:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_02.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-313\" alt=\"09_MarkerSet_02\" src=\"http:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_02-300x143.jpg\" width=\"300\" height=\"143\" srcset=\"https:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_02-300x143.jpg 300w, https:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_02-500x239.jpg 500w, https:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_02.jpg 526w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>_, ,_<br \/>\n\uff08\u3000\u30fb\u0434\u30fb\uff09 \u305d\u3053\u8098\u3084\u3093\uff01\uff01<br \/>\n\u2282\u5f61\u2606))\u0414\u00b4\uff09<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4e07\u4eba\u306b\u7406\u89e3\u3057\u3084\u3059\u3044\u69d8\u306b\u5bfe\u5fdc\u8868\u3092\u66f8\u3044\u3066\u304a\u304f\u3068<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 18px;\">\u25a0\u5bfe\u5fdc\u8868<\/span><\/strong><br \/>\n<a href=\"http:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_03.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-315\" alt=\"09_MarkerSet_03\" src=\"http:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_03-300x130.jpg\" width=\"300\" height=\"130\" srcset=\"https:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_03-300x130.jpg 300w, https:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_03-500x217.jpg 500w, https:\/\/humrevlife.com\/wp-content\/uploads\/2013\/07\/09_MarkerSet_03.jpg 523w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 18px;\">\u25a0\u767b\u9332\u3057\u305f\u30de\u30fc\u30ab\u30fc\u3092\u89e3\u9664\u3059\u308b\u65b9\u6cd5<\/span><\/strong><\/p>\n<p>[python]<br \/>\nfrom pyfbsdk import FBApplication,FBActor,FBMarkerSet,FBModelMarker<\/p>\n<p>lActor = FBApplication().CurrentActor<br \/>\nlMkSet = None<br \/>\nif not lActor:<br \/>\n    lActor = FBActor(&quot;mike&quot;)<br \/>\n    lMkset = FBMarkerSet(&quot;mike_Mkset&quot;)<br \/>\n    lActor.MarkerSet = lMkset<\/p>\n<p>if not lMkSet:<br \/>\n    lMkSet = lActor.MarkerSet<\/p>\n<p>lName = &quot;LeftShoulder&quot;<br \/>\nlObj = FBModelMarker(lName)<\/p>\n<p>lIndex = 1<br \/>\nlIsUse = False<br \/>\nlMkSet.PropertyList.Find(&quot;%s%d.Used&quot;%(lName,lIndex)).Data = lIsUse<br \/>\nlMkSet.PropertyList.Find(&quot;%s%d.Name&quot;%(lName,lIndex)).Data = &quot;&quot;<br \/>\nlProp = lMkSet.PropertyList.Find(&quot;%s%d.Model&quot;%(lName,lIndex))<br \/>\nlProp.remove(lMdl)<\/p>\n<p>[\/python]<\/p>\n<p>\u3081\u3061\u3083\u304f\u3061\u3083\u91cd\u8981\u306a\u3093\u3067\u3059\u304cFBMarkerSet\u306e\u5404\u90e8\u4f4d\u306eProperty\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u969b\u3001<\/p>\n<p>\u90e8\u4f4d\u540d.Model<\/p>\n<p>\u3067\u306f\u306a\u304f\u3001<\/p>\n<p>\u90e8\u4f4d\u540d1.Model<br \/>\n\u90e8\u4f4d\u540d2.Model<\/p>\n<p>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3055\u3048\u7406\u89e3\u3057\u3066\u3044\u308c\u3070\u3044\u308d\u3044\u308d\u3068\u6357\u308a\u307e\u3059\u3002<\/p>\n<p>\u7686\u3055\u3093\u6c17\u3065\u304d\u307e\u3057\u305f\u304b\uff1f<\/p>\n<p>FBSkeletonNodeId\u767b\u9332\u3092\u89e3\u9664\u3059\u308b\u3068\u304d\u306b\u306f\u4f7f\u3063\u3066\u306a\u3044\u3093\u3067\u3059\u3088\u306d\u3047\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067<strong><span style=\"color: #ff0000; font-size: 14px;\">\u767b\u9332\u3082FBSkeletonId\u3092\u4f7f\u308f\u305a\u306b\u5b9f\u306f\u3067\u304d\u3061\u3083\u3044\u307e\u3059\uff01<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 18px;\">\u25a0FBMarkerSet\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u767b\u9332\u3059\u308b\uff08PropertyList ver\uff09<\/span><\/strong><\/p>\n<p>[python]<\/p>\n<p>from pyfbsdk import FBApplication,FBActor,FBMarkerSet,FBModelMarker<\/p>\n<p>lActor = FBApplication().CurrentActor<br \/>\nlMkSet = None<br \/>\nif not lActor:<br \/>\n    lActor = FBActor(&quot;mike&quot;)<br \/>\n    lMkset = FBMarkerSet(&quot;mike_Mkset&quot;)<br \/>\n    lActor.MarkerSet = lMkset<\/p>\n<p>if not lMkSet:<br \/>\n    lMkSet = lActor.MarkerSet<\/p>\n<p>lIndex = 1<br \/>\nlIsUse = True<br \/>\nlName = &quot;LeftShoulder&quot;<br \/>\nlMkSet.PropertyList.Find(&quot;%s%d.Used&quot;%(lName,lIndex)).Data = lIsUse<br \/>\nlMkSet.PropertyList.Find(&quot;%s%d.Name&quot;%(lName,lIndex)).Data = lName<br \/>\nlProp = lMkSet.PropertyList.Find(&quot;%s%d.Model&quot;%(lName,lIndex))<br \/>\nlProp.add(lMdl)<\/p>\n<p>[\/python]<\/p>\n","protected":false},"excerpt":{"rendered":"\u4eca\u65e5\u306f\u305d\u306e8\u306e\u7d9a\u304d\u3067MarkerSet\u306bObject\u3092\u767b\u9332\u3059\u308b\u65b9\u6cd5\u306e\u304a\u8a71\u3002 \u3084\u3070\u3044\u3001\u4e2d\u8eab\u6fc3\u3044\u3067\u3059\u3002\u3002\u3002 &nbsp; \u25a0MarkerSet\u306bObject\u3092\u767b\u9332\u3059\u308b [python] from pyfbsdk import &#8230;","protected":false},"author":1,"featured_media":312,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[66,40,65,25,237,64,26,28,18],"class_list":["post-309","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-motionbuilder","category-python","tag-addmarker","tag-fb","tag-fbskeletonnodeid","tag-mb","tag-motionbuilder","tag-propety","tag-py","tag-pyfbsdk","tag-python-2"],"_links":{"self":[{"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/posts\/309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/humrevlife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=309"}],"version-history":[{"count":5,"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":318,"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/posts\/309\/revisions\/318"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/media\/312"}],"wp:attachment":[{"href":"https:\/\/humrevlife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/humrevlife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/humrevlife.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}