{"id":385,"date":"2013-08-24T20:11:42","date_gmt":"2013-08-24T11:11:42","guid":{"rendered":"http:\/\/humrevlife.com\/?p=385"},"modified":"2013-08-24T20:11:42","modified_gmt":"2013-08-24T11:11:42","slug":"mwp-motionbuilder-with-python%e3%80%80%e3%81%9d%e3%81%ae13%e3%80%80%e3%80%8cfbconstraint%e3%81%ae%e8%a8%ad%e5%ae%9a%e6%96%b9%e6%b3%95%e3%80%8d","status":"publish","type":"post","link":"https:\/\/humrevlife.com\/?p=385","title":{"rendered":"MWP (Motionbuilder With Python)\u3000\u305d\u306e13\u3000\u300cFBConstraint\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d"},"content":{"rendered":"<p><span style=\"font-size: 14px;\">\u4eca\u56de\u306fConstarint\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u3092\u66f8\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u307e\u305a\u3001\u4efb\u610f\u306eConstraint\u3092\u4f5c\u308b\u3068\u304d\u306b\u306f\u3001FBConstraintmanager\u30af\u30e9\u30b9\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 18px;\"><strong>\u25a0Constraint\u306e\u751f\u6210<\/strong><\/span><\/p>\n<p>[python]<br \/>\nfrom pyfbsdk import FBConstraintManager<\/p>\n<p>lMgr = FBConstraintManager()<\/p>\n<p>for lIdx in range(lMgr.TypeGetCount()):<br \/>\n    lConst = lMgr.TypeCreateConstraint( lIdx )<\/p>\n<p>[\/python]<\/p>\n<p>\u3053\u3053\u3067\u306f\u5168Constraint\u3092\u751f\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>TypeGetCount()\u3092\u4f7f\u3046\u3053\u3068\u3067Constraint\u306e\u7a2e\u985e\u306e\u7dcf\u6570\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001TypeCreateConstraint\u306e\u7b2c\u4e00\u5f15\u6570\u306fInt\u578b\u304b\u3001string\u3092\u6e21\u3059\u3053\u3068\u3067\u5404\u7a2eConstarint\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 18px;\"><strong>\u25a0TypeCreateConstraint\u306e\u5bfe\u5fdc\u8868<\/strong><\/span><\/p>\n<table style=\"width: 191px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col width=\"55\" \/>\n<col width=\"136\" \/> <\/colgroup>\n<tbody>\n<tr>\n<td width=\"55\" height=\"20\">Index<\/td>\n<td width=\"136\">string<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">0<\/td>\n<td>Aim<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">1<\/td>\n<td>Expression<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">2<\/td>\n<td>Multi Referential<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">3<\/td>\n<td>Parent\/Child<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">4<\/td>\n<td>Path<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">5<\/td>\n<td>Position<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">6<\/td>\n<td>Range<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">7<\/td>\n<td>Relation<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">8<\/td>\n<td>Rigid Body<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">9<\/td>\n<td>3 Points<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">10<\/td>\n<td>Rotation<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">11<\/td>\n<td>Scale<\/td>\n<\/tr>\n<tr>\n<td height=\"19\">12<\/td>\n<td>Mapping<\/td>\n<\/tr>\n<tr>\n<td height=\"20\">13<\/td>\n<td>Chain IK<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>string\u306f\u751f\u6210\u3057\u305f\u3044Constraint\u540d\u3092\u6e21\u3059\u4e8b\u3067\u76ee\u7684\u306eConstraint\u304c\u751f\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u3055\u3066\u3001\u672c\u756a\u306f\u3053\u308c\u304b\u3089\u306a\u306e\u3067\u3059\u304c\u3001<\/p>\n<p><span style=\"font-size: 14px;\">MB2010\u3067\u306f\u751f\u6210\u3057\u305f<span style=\"color: #ff0000;\">Constarint\u306esource\u306b\u4f55\u3082\u95a2\u9023\u4ed8\u3051\u3089\u308c\u3066\u3044\u306a\u3044\u3068UI\u4e0a\u3067\u306f\u78ba\u304b\u306b\u5b58\u5728\u3059\u308bProperty\u304c\u898b\u3064\u3051\u308c\u307e\u305b\u3093\u3002<\/span><\/span><\/p>\n<p><span style=\"color: #000000;\">Constrained object (Child)\u3000\u306eProperty\u304cPropertyList\u3067\u306a\u305c\u304b\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/span><\/p>\n<p><a href=\"http:\/\/humrevlife.com\/wp-content\/uploads\/2013\/08\/13_Constraint_01.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"13_Constraint_01\" src=\"http:\/\/humrevlife.com\/wp-content\/uploads\/2013\/08\/13_Constraint_01-300x127.jpg\" width=\"300\" height=\"127\" \/><\/a><\/p>\n<p>\u3061\u306a\u307f\u306bMB\u306e\u30b5\u30f3\u30d7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3042\u308bPropertyDrop.py\u3092\u4f7f\u3063\u3066\u3082\u3001MB2010\u540c\u69d8\u306bMB2014\u3067\u3082\u898b\u3064\u3051\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u306f\u3001<\/p>\n<p>PropetyList\u306bProperty\u304c\u5b58\u5728\u305b\u305a\u81ea\u5206\u3067Property\u3092\u8ffd\u52a0\u3057\u306a\u3051\u308c\u3070\u4f7f\u3044\u7269\u306b\u306a\u3089\u306a\u3044\u306f\u305a\u3002\u3002\u3002\u3002<\/p>\n<p>\u5ff5\u306e\u305f\u3081PropertyList\u3092python\u3067\u5168\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><a href=\"http:\/\/humrevlife.com\/wp-content\/uploads\/2013\/08\/13_Constraint_021.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-395\" alt=\"13_Constraint_02\" src=\"http:\/\/humrevlife.com\/wp-content\/uploads\/2013\/08\/13_Constraint_021-300x258.jpg\" width=\"300\" height=\"258\" srcset=\"https:\/\/humrevlife.com\/wp-content\/uploads\/2013\/08\/13_Constraint_021-300x258.jpg 300w, https:\/\/humrevlife.com\/wp-content\/uploads\/2013\/08\/13_Constraint_021-500x430.jpg 500w, https:\/\/humrevlife.com\/wp-content\/uploads\/2013\/08\/13_Constraint_021.jpg 693w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14px;\">\u3002\u3002\u3002(\u00b4\uff9f\u0434\uff9f\uff40)\uff8e\uff9f\uff76\uff70\uff9d<\/span><\/p>\n<p>2014\u3067\u306f\u554f\u984c\u306a\u3044\u3067\u3059\u306d\uff08<\/p>\n<p>\u305d\u308c\u3058\u3083\u6c17\u517c\u306d\u306a\u304fconstraint\u3092\u7d44\u307f\u307e\u3057\u3087\u3046<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 18px;\"><strong>\u25a0Constraint\u3092\u8a2d\u5b9a\u3059\u308b<\/strong><\/span><\/p>\n<p>[python]<br \/>\nfrom pyfbsdk import FBConstraintManager,FBModelList,FBGetSelectedModels<\/p>\n<p>lMgr = FBConstraintManager()<br \/>\nlConst = lMgr.TypeCreateConstraint(&quot;Parent\/Child&quot;)<br \/>\nlPropertyName = &quot;Constrained object (Child)&quot;<br \/>\nlMdlList = FBModelList()<br \/>\nFBGetSelectedModels( lMdlList )<\/p>\n<p>lConst.PropertyList.Find(lPropertyName).append(lMdlList[0])<br \/>\nlConst.Active = True<br \/>\nlConst.Lock = True<br \/>\n[\/python]<\/p>\n<p>\u73fe\u5728\u9078\u629e\u3055\u308c\u3066\u3044\u308bFBModel\u3092Constrained object (Child)\u306b\u8ffd\u52a0\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001<span style=\"color: #ff0000;\">\u751f\u6210\u3055\u308c\u305f\u76f4\u5f8c\u3067\u306fConstrain\u306fActive\u3068Lock\u306b\u30c1\u30a7\u30c3\u30af\u304c\u5165\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/span><\/p>\n<p>UI\u4e0a\u306b\u5b58\u5728\u3059\u308bConstraint\u3000Settings\u4e2d\u306e\u9805\u76ee\u540d\u304c\u305d\u306e\u307e\u307ePropertyList\u306b\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4eca\u56de\u306fConstarint\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u3092\u66f8\u304d\u307e\u3059\u3002 \u307e\u305a\u3001\u4efb\u610f\u306eConstraint\u3092\u4f5c\u308b\u3068\u304d\u306b\u306f\u3001FBConstraintmanager\u30af\u30e9\u30b9\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 &nbsp; &nbsp; \u25a0Constraint &#8230;","protected":false},"author":1,"featured_media":396,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[40,98,95,25,237,100,99,26,28,18,96,97],"class_list":["post-385","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-motionbuilder","category-python","tag-fb","tag-fbconstraint","tag-fbconstraintmanager","tag-mb","tag-motionbuilder","tag-parentchild","tag-propertylist","tag-py","tag-pyfbsdk","tag-python-2","tag-typecreateconstraint","tag-typegetcount"],"_links":{"self":[{"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/posts\/385","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=385"}],"version-history":[{"count":4,"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/posts\/385\/revisions"}],"predecessor-version":[{"id":397,"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/posts\/385\/revisions\/397"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/humrevlife.com\/index.php?rest_route=\/wp\/v2\/media\/396"}],"wp:attachment":[{"href":"https:\/\/humrevlife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/humrevlife.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/humrevlife.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}