{"id":17711,"date":"2019-01-23T15:26:09","date_gmt":"2019-01-23T06:26:09","guid":{"rendered":"https:\/\/labs.gree.jp\/blog\/?p=17711"},"modified":"2019-01-23T15:40:38","modified_gmt":"2019-01-23T06:40:38","slug":"psd-js%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6photoshop%e3%81%ae%e3%83%ac%e3%82%a4%e3%83%a4%e3%83%bc%e5%91%bd%e5%90%8d%e8%a6%8f%e5%89%87%e3%81%ae%e3%83%81%e3%82%a7%e3%83%83%e3%82%af%e3%82%92%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/labs.gree.jp\/blog\/2019\/01\/17711\/","title":{"rendered":"PSD.js\u3092\u4f7f\u3063\u3066Photoshop\u306e\u30ec\u30a4\u30e4\u30fc\u547d\u540d\u898f\u5247\u306e\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046"},"content":{"rendered":"<p>\u3054\u3076\u3055\u305f\u3057\u3066\u304a\u308a\u307e\u3059\u3002\u3061\u3087\u3073\u3048\u3067\u3059\u3002<\/p>\n<p>\u6700\u8fd1\u306fblender2.8\u306e\u30d9\u30fc\u30bf\u304c\u51fa\u59cb\u3081\u305f\u306e\u3067\u30e2\u30c7\u30ea\u30f3\u30b0\u3084\u3089\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3084\u3063\u3066\u904a\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<p>\u524d\u3005\u304b\u3089ZBrush\u3084\u3089houdini\u3067\u904a\u3093\u3067\u307e\u3057\u305f\u304c\u3001\u30dd\u30ea\u30b4\u30f3\u30d5\u30ed\u30fc\u306e\u826f\u3057\u60aa\u3057\u3068\u304b\u8a00\u308f\u308c\u3066\u3082\u3088\u304f\u308f\u304b\u3089\u3093\u3001\u3068\u3044\u3046\u4e8b\u3067\u30e2\u30c7\u30ea\u30f3\u30b0\u306b\u624b\u3092\u51fa\u3057\u59cb\u3081\u305f\u3093\u3067\u3059\u304c\u3084\u3063\u3066\u307f\u308b\u3068\u697d\u3057\u3044\u3067\u3059\u306d\u3047\u3002<\/p>\n<p>2.8\u3067\u306f\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u30a8\u30f3\u30b8\u30f3\u306bEevee\u304c\u5165\u3063\u305f\u306e\u3067\u308f\u308a\u3068\u30b2\u30fc\u30e0\u306b\u8fd1\u3044\u63cf\u753b\u65b9\u6cd5\u3068\u306a\u3063\u3066\u304d\u3066\u3044\u307e\u3059\u3057\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u304c\u9ed2\u7cfb\u306e\u30c6\u30fc\u30de\u3067\u898b\u6163\u308c\u305f\u753b\u9762\u3067\u3059\u3057\u3001\u30dd\u30b9\u30c8\u30a8\u30d5\u30a7\u30af\u30c8\u306a\u3069\u3082\u3064\u3089\u3064\u3089\u3044\u3058\u3063\u3066\u8a66\u305b\u308b\u306e\u3067\u624b\u3064\u3051\u3066\u304a\u304f\u306e\u30aa\u30b9\u30b9\u30e1\u3067\u3059\u3088\u3002<br \/>\n(\u8fd1\u3044\u3068\u3044\u3063\u3066\u3082\u30b2\u30fc\u30e0\u306eshading\u306e\u8003\u3048\u3067node\u7d44\u307f\u7acb\u3066\u3089\u308c\u308b\u304b\u3001\u3068\u3044\u3046\u3068\u305d\u3046\u3067\u306f\u306a\u3044\u306e\u3067\u6238\u60d1\u3063\u305f\u308a\u3082\u3057\u307e\u3059\u304c)<\/p>\n<p>\u3055\u3066\u3001\u4eca\u65e5\u306f\u30b2\u30fc\u30e0\u306e\u30a2\u30bb\u30c3\u30c8\u5236\u4f5c\u3092\u3057\u3066\u3044\u304f\u3068\u6c17\u306b\u306a\u3063\u3066\u304f\u308bPSD\u30d5\u30a1\u30a4\u30eb\u306e\u547d\u540d\u898f\u5247\u30c1\u30a7\u30c3\u30af\u306b\u3064\u3044\u3066\u66f8\u3044\u3066\u307f\u3088\u3046\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u80cc\u666f<\/h3>\n<p>\u30b2\u30fc\u30e0\u3067\u306f\u3044\u308f\u3086\u308b\u91cf\u7523\u7cfb\u3068\u547c\u3070\u308c\u308b\u753b\u50cf\u30a2\u30bb\u30c3\u30c8\u304c\u3042\u308a\u3001\u6982\u306d\u540c\u3058\u4ed5\u69d8\u3067\u5236\u4f5c\u3057\u3066\u3042\u3068\u3067\u81ea\u52d5\u5909\u63db\u7b49\u306e\u51e6\u7406\u3092\u3057\u3066\u3044\u304f\u4e8b\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u624b\u52d5\u3067\u3061\u307e\u3061\u307e\u5909\u63db\u3057\u3066\u30821\u679a\u3042\u305f\u308a\u6570\u5206\u3067\u7d42\u308f\u308b\u306e\u3067\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u306b\u4f59\u88d5\u304c\u3042\u308c\u3070\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u304c\u3001\u3075\u3044\u306b\u5168\u30b3\u30f3\u30d0\u30fc\u30c8\u3057\u3066\u304f\u308c\u3068\u304b\u8a00\u308f\u308c\u308b\u3068\u6570\u91cf\u304c\u591a\u304f\u3066\u3060\u3044\u3076\u3057\u3093\u3069\u3044\u4f5c\u696d\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u305d\u3046\u3044\u3046\u306e\u306f\u8f9b\u3044\u3093\u3067\u5148\u306b\u3044\u308d\u3044\u308d\u6e96\u5099\u3057\u3066\u304a\u304f\u3068\u6357\u308b\u3063\u3066\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u3067\u3001\u3053\u306e\u81ea\u52d5\u51e6\u7406\u3092\u3084\u3063\u3066\u3044\u304f\u4e0a\u3067\u554f\u984c\u306b\u306a\u3063\u3066\u304f\u308b\u306e\u304c\u3001\u671f\u5f85\u3059\u308b\u4ed5\u69d8\u3068\u4e00\u81f4\u3057\u306a\u3044\u69cb\u6210\u306b\u306a\u3063\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<br \/>\n\u3088\u304f\u3042\u308b\u4f8b\u3068\u3057\u3066\u30ec\u30a4\u30e4\u30fc\u540d\u3084\u3001\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8\u69cb\u9020\u304c\u671f\u5f85\u3057\u305f\u3068\u304a\u308a\u3067\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u304c\u7d1b\u308c\u8fbc\u3093\u3067\u3044\u308b\u3001\u3068\u3044\u3046\u72b6\u6cc1\u3067\u3059\u3002<\/p>\n<p>\u6570\u304c10\u308420\u7a0b\u5ea6\u3060\u3063\u305f\u3089\u307e\u3060\u4eba\u306e\u76ee\u3067\u30c1\u30a7\u30c3\u30af\u7b49\u3082\u53ef\u80fd\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u6570\u3084\u7a2e\u985e\u304c\u5897\u3048\u308c\u3070\u5897\u3048\u308b\u307b\u3069\u76ee\u8996\u3067\u306e\u30c1\u30a7\u30c3\u30af\u306f\u96e3\u3057\u304f\u306a\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u6642\u9593\u304c\u7d4c\u904e\u3057\u3066\u3044\u304f\u3068\u30e1\u30f3\u30d0\u30fc\u7570\u52d5\u306a\u3069\u306b\u3088\u308b\u5f15\u304d\u7d99\u304e\u3067\u30c1\u30a7\u30c3\u30af\u3059\u3079\u304d\u9805\u76ee\u304c\u5f15\u304d\u7d99\u304c\u308c\u306a\u304b\u3063\u305f\u308a\u3057\u3066\u3057\u307e\u3063\u305f\u308a\u3001\u3068\u3066\u3082\u5fd9\u3057\u3044\u6642\u306b\u9650\u3063\u3066\u78ba\u8a8d\u30df\u30b9\u3063\u3066\u6642\u9593\u304c\u304b\u304b\u308bimport\u3084\u308a\u76f4\u3057\u3001\u3068\u304b\u3082\u3042\u308a\u304c\u3061\u3067\u3059\u3002<br \/>\n\u3053\u3046\u3044\u3063\u305f\u3082\u306e\u306f\u53ef\u80fd\u3067\u3042\u308c\u3070\u30d7\u30ed\u30b0\u30e9\u30e0\u5074\u3067\u30c1\u30a7\u30c3\u30af\u3059\u3079\u304d\u4ed5\u69d8\u3068\u3057\u3066\u6b8b\u3057\u3066\u304a\u304d\u305f\u3044\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u3053\u3046\u3044\u3063\u305f\u4e8b\u4f8b\u306e\u5834\u5408\u3001\u3088\u304f\u3042\u308bPhotoshop\u3067\u306e\u89e3\u6c7a\u65b9\u6cd5\u3068\u3057\u3066jsx\u3092\u4f7f\u3063\u305f\u30b9\u30af\u30ea\u30d7\u30c6\u30a3\u30f3\u30b0\u3067\u306e\u30c1\u30a7\u30c3\u30af\u304c\u3042\u308a\u307e\u3059\u3002\u3057\u304b\u3057\u306a\u304c\u3089\u3001\u7d0d\u54c1\u3055\u308c\u3066\u3044\u304fpsd\u30d5\u30a1\u30a4\u30eb\u306f\u305f\u3044\u3066\u3044\u8907\u96d1\u3001\u5de8\u5927\u306b\u306a\u3063\u3066\u3044\u304f\u306e\u3067photoshop\u3092\u64cd\u4f5c\u3059\u308bAPI\u306e\u90fd\u5408\u4e0ajsx\u3067\u3084\u3063\u3066\u3044\u308b\u3068\u30ec\u30a4\u30e4\u30fc\u5de1\u56de\u7b49\u306b\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u8ab2\u984c\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u4eca\u65e5\u306f<a href=\"https:\/\/github.com\/meltingice\/psd.js\" target=\"_blank\">PSD.js<\/a>\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3063\u3066\u30ec\u30a4\u30e4\u30fc\u69cb\u6210\u306e\u30c1\u30a7\u30c3\u30af\u3092\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u3064\u3044\u3066\u7c21\u5358\u306b\u89e3\u8aac\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u5bfe\u8c61\u3068\u3059\u308b\u8aad\u8005<\/h3>\n<ul>\n<li>node.js\u304c\u30c1\u30e7\u30c3\u30c8\u5206\u304b\u3063\u3066DCC\u30c4\u30fc\u30eb\u5468\u308a\u306b\u8208\u5473\u304c\u3042\u308b\u65b9(\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066npm\u305f\u305f\u3051\u308c\u3070\u5927\u4e08\u592b)<\/li>\n<li>\u3053\u3093\u306a\u30c1\u30a7\u30c3\u30af\u76ee\u8996\u3067\u3084\u308a\u305f\u304f\u306a\u3044\u3093\u3060\uff01\u3068\u3044\u3046\u65b9<\/li>\n<\/ul>\n<h3>\u30ec\u30a4\u30e4\u30bb\u30c3\u30c8\u69cb\u6210<\/h3>\n<p>\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u306b\u306f\u30eb\u30fc\u30eb\u304c\u5fc5\u8981\u3067\u3059\u3002\u4eca\u56de\u306f\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u7d75\u306epsd\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406\u3059\u308b\u3001\u3068\u3044\u3046\u4f53\u3067\u30fb\u30fb\u30fb<\/p>\n<blockquote><p>\n\u30fb\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u7d75\u306epsd\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u4e8b\u524d\u306b\u6c7a\u3081\u3089\u308c\u305f\u5404\u90e8\u4f4d\u3054\u3068\u306b\u300c\uff5e.png\u300d\u3068\u3064\u3044\u305f\u30ec\u30a4\u30e4\u30fc\u304c\u3042\u308a\u3001\u5f8c\u5de5\u7a0b\u306e\u81ea\u52d5\u5909\u63db\u3067\u30d1\u30fc\u30c4\u3054\u3068\u306b\u66f8\u304d\u51fa\u3057\u3057\u305f\u3044\u3002\n<\/p><\/blockquote>\n<p>\u3053\u3093\u306a\u304a\u984c\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u3084\u308b\u524d\u6bb5\u306e\u30c1\u30a7\u30c3\u30af\u51e6\u7406\u3068\u3057\u3066\u3001\u4e8b\u524d\u306b\u5b9a\u7fa9\u3057\u305f\u547d\u540d\u898f\u7d04\u306b\u305d\u3063\u305f\u30ec\u30a4\u30e4\u69cb\u6210\u3067\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u3089\u308c\u3066\u3044\u308b\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u305e\uff01\u3068\u3044\u3046\u306e\u304c\u4eca\u56de\u306e\u8a18\u4e8b\u306e\u7bc4\u56f2\u3067\u3059\u3002<br \/>\n\u3084\u3084\u3053\u3057\u3044\u3067\u3059\u306d\u3002\u305d\u3044\u3067\u306f\u3044\u308d\u3044\u308d\u5fc5\u8981\u306a\u3053\u3068\u3092\u8003\u3048\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>\u5927\u96d1\u628a\u306aPSD\u30d5\u30a1\u30a4\u30eb\u306e\u30eb\u30fc\u30eb<\/h3>\n<ul>\n<li>suffix\u3068\u3057\u3066.png\u3068\u3064\u3044\u3066\u3044\u308b\u30ec\u30a4\u30e4\u30fc\/\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8\u306f\u5f8c\u7d9a\u306e\u51e6\u7406\u3067\u30d1\u30fc\u30c4\u66f8\u304d\u51fa\u3057\u3068\u3057\u3066\u5229\u7528\u3055\u308c\u308b(\u4eca\u56de\u306e\u7bc4\u56f2\u306e\u5bfe\u8c61\u5916)<\/li>\n<li>\u547d\u540d\u306e\u5148\u982d\u306b#\uff08\u3082\u3057\u304f\u306f\u5168\u89d2\uff03(\u6ce8:\u5168\u89d2\u3082\u8a31\u5bb9\u3057\u305f\u3044\u3053\u3068\u306f\u3088\u304f\u3042\u308b)\uff09\u304c\u3042\u308b\u30ec\u30a4\u30e4\/\u30ec\u30a4\u30e4\u30bb\u30c3\u30c8\u306f\u30c1\u30a7\u30c3\u30af\u3092\u30b9\u30ad\u30c3\u30d7\u3059\u308b\uff08\u975e\u8868\u793a\u7528\uff09<\/li>\n<li>hair,face,body\u306f\u5fc5\u9808\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8\u3068\u3057\u3066\u5b58\u5728\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u671f\u5f85\u3059\u308b(\u4eca\u56de\u306f\u8aac\u660e\u306e\u7701\u7565\u3067\u5fc5\u9808\u304b\u3068\u3044\u3046\u306e\u306f\u30c1\u30a7\u30c3\u30af\u3057\u306a\u3044\u3053\u3068\u306b\u3057\u307e\u3059)<\/li>\n<li>\u5404\u90e8\u4f4d\u306b\u306f\u5fc5\u9808\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8(face\u3067\u3042\u308c\u3070normal.png\u3001body\u3067\u3042\u308c\u3070body.png)\u3092\u5fc5\u8981\u3068\u3059\u308b(\u4eca\u56de\u306f\u8aac\u660e\u306e\u7701\u7565\u3067\u5fc5\u9808\u304b\u3068\u3044\u3046\u306e\u306f\u30c1\u30a7\u30c3\u30af\u3057\u306a\u3044\u3053\u3068\u306b\u3057\u307e\u3059)<\/li>\n<li>\u5404\u90e8\u4f4d\u306b\u306foptional\u306a\u30ec\u30a4\u30e4\u30fc\/\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8\u3068\u3057\u3066\u767b\u9332\u3055\u308c\u305f\u540d\u79f0\u3067\u3042\u308c\u3070\u4f7f\u3063\u3066\u3082\u826f\u3044(face\u3067\u3042\u308c\u3070normal.png, lough.png)<\/li>\n<li>psd\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306f\u4e92\u63db\u6027\u3092\u512a\u5148\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3064\u3051\u3066\u3044\u308b(\u30e9\u30a4\u30d6\u30e9\u30ea\u5074\u3067parse\u3067\u304d\u306a\u304b\u3063\u305f\u308a\u3057\u307e\u3059)<\/li>\n<\/ul>\n<p>\u203b\u305d\u306e\u4ed6\u90e8\u5206\u306b\u95a2\u3057\u3066\u306f\u4eca\u56de\u6700\u5c0f\u306e\u30b5\u30f3\u30d7\u30eb\u306a\u306e\u3067\u30c1\u30a7\u30c3\u30af\u3057\u307e\u305b\u3093\u3002<\/p>\n<h3>\u57fa\u6e96\u3068\u306a\u308b\u30ec\u30a4\u30e4\u30fc\u30bb\u30c3\u30c8\u69cb\u6210\u30b5\u30f3\u30d7\u30eb<\/h3>\n<p>\u305d\u308c\u3067\u306fpsd\u30d5\u30a1\u30a4\u30eb\u306e\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u3092\u793a\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2019\/01\/psd_example.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2019\/01\/psd_example.jpg\" alt=\"\" width=\"702\" height=\"642\" class=\"alignnone size-full wp-image-17713\" srcset=\"https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2019\/01\/psd_example.jpg 702w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2019\/01\/psd_example-219x200.jpg 219w, https:\/\/labs.gree.jp\/blog\/wp-content\/uploads\/2019\/01\/psd_example-437x400.jpg 437w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/a><\/p>\n<p>\u30c6\u30ad\u30b9\u30c8\u3067\u66f8\u304d\u4e0b\u3059\u3068\u6982\u306d\u4e0b\u8a18\u306e\u3088\u3046\u306a\u69cb\u6210\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u5b9f\u969b\u306e\u30b2\u30fc\u30e0\u958b\u767a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3060\u3068\u6982\u306d\u6570\u500d\u4ee5\u4e0a\u306e\u8907\u96d1\u3055\u304c\u3042\u308b\u3068\u601d\u3063\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u76f8\u9055\u306a\u3044\u304b\u3068\u3002<\/p>\n<pre>\n# \u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u7528\u30ec\u30a4\u30e4\/\u30ec\u30a4\u30e4\u30bb\u30c3\u30c8\n`hair\n  `front_hair.png\n`face\n  `normal.png\n  `lough.png\n`body\n  `body.png\n  `body_b.png\n<\/pre>\n<p>\u4e0a\u8a18\u306e\u30b5\u30f3\u30d7\u30ebpsd\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066Github\u306b<a href=\"https:\/\/github.com\/gree\/validate_example\/blob\/master\/example.psd\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30d5\u30a1\u30a4\u30eb<\/a>\u3092\u7528\u610f\u3057\u3066\u3042\u308a\u307e\u3059\u3002<br \/>\n(\u3054\u81ea\u8eab\u306e\u8cac\u4efb\u3067\u3054\u5229\u7528\u304f\u3060\u3055\u3044)<\/p>\n<h3>\u30c1\u30a7\u30c3\u30af\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u671f\u5f85\u3059\u308b\u6a5f\u80fd<\/h3>\n<p>\u30c1\u30a7\u30c3\u30af\u304c\u884c\u3048\u308b\u6700\u5c0f\u306e\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u6b21\u306e\u3088\u3046\u306a\u6a5f\u80fd\u3068\u3057\u307e\u3059<\/p>\n<p>\u30fb\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u5b9f\u884c\u3059\u308b<br \/>\n\u30fb\u5f15\u6570\u304b\u3089\u5358\u4e00\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u53d6\u5f97\u3057\u3066\u3001\u4e8b\u524d\u306b\u5b9a\u7fa9\u3055\u308c\u305f\u30ec\u30a4\u30e4\u540d\u306e\u30eb\u30fc\u30eb\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046<br \/>\n\u30fb\u30a8\u30e9\u30fc\u304c\u898b\u3064\u304b\u3063\u305f\u5834\u5408\u306f\u6a19\u6e96\u30a8\u30e9\u30fc\u306b\u51fa\u529b\u3092\u884c\u3044\u3001\u7d42\u4e86\u3059\u308b<br \/>\n\u30fb\u91cd\u8907\u3057\u305f\u30ec\u30a4\u30e4\u540d\u304c\u3042\u3063\u305f\u5834\u5408\u306f\u30a8\u30e9\u30fc\u3068\u3059\u308b<br \/>\n\u30fb\u30c7\u30d0\u30c3\u30b0\u8868\u793a\u3068\u3057\u3066\u73fe\u5728\u51e6\u7406\u4e2d\u306e\u30ec\u30a4\u30e4\u540d\u7b49\u3092\u51fa\u529b\u3059\u308b<br \/>\n\u30fb\u30ec\u30a4\u30e4\u30bb\u30c3\u30c8\u306a\u3069\u306e\u9806\u756a\u306f\u6c17\u306b\u3057\u306a\u3044\u3053\u3068\u306b\u3059\u308b<br \/>\n\u30fb\u518d\u5e30\u7684\u306b\u30ec\u30a4\u30e4\u3092\u8fbf\u3063\u3066\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u3002\u306a\u304a\u89aa\u306f\u76f4\u524d\u306e\u89aa\u307e\u3067\u306f\u5f15\u6570\u306b\u6e21\u3059<\/p>\n<h3>\u30b3\u30fc\u30c9\u51e6\u7406<\/h3>\n<p>\u307e\u305a\u306f\u304a\u7d04\u675f\u3068\u3057\u3066\u3053\u3046\u3044\u3046\u51e6\u7406\u3092\u8a66\u3059\u5834\u5408\u306f<\/p>\n<p><b>\u5fc5\u305a\u30ed\u30fc\u30ab\u30eb\u306b\u30c7\u30fc\u30bf\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u4f5c\u6210\u3057\u3066\u3001\u30ed\u30fc\u30ab\u30eb\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066\u51e6\u7406\u3057\u3066\u554f\u984c\u304c\u306a\u3044\u304b\u3092\u691c\u8a3c\u3057\u304d\u308b<\/b><\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3092\u5fc3\u304c\u3051\u3066\u304f\u3060\u3055\u3044\u3002\u30b3\u30fc\u30c9\u30df\u30b9\u3063\u3066\u3066\u672c\u30c7\u30fc\u30bf\u3092\u3046\u3063\u304b\u308a\u4e0a\u66f8\u304d\u3057\u3061\u3083\u3063\u305f\u65e5\u306b\u3083\u3041\u76ee\u3082\u5f53\u3066\u3089\u308c\u306d\u3047\u3067\u3059\u3002<\/p>\n<p>\u305d\u3044\u3067\u306f\u3055\u304f\u3055\u304f\u3068\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>package.json<\/p>\n<pre class=\"lang:js decode:true \" >{\n  \"name\": \"psd-validator\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"validate.js\",\n  \"dependencies\": {\n    \"psd\": \"^3.2.0\"\n  },\n  \"devDependencies\": {},\n  \"author\": \"chobi_e\",\n  \"license\": \"CC0\"\n}\n<\/pre>\n<p>validate.js<\/p>\n<pre class=\"lang:js decode:true \" >\nvar path = require('path');\nvar PSD = require('psd');\n\n\/\/ \u521d\u671f\u5316\nvar errors = [];\n\/\/ node validate.js example.psd\u3067\u3084\u308b\u306e\u3067argv\u306f2\u3002\u9069\u5207\u306b\u5909\u3048\u3066\u306d\u3002\nvar file =  process.argv[2];\nvar file_path = path.resolve(file);\n\nvar layerset_rules = [\"hair\", \"face\", \"body\"];\nvar per_rules = {\n    \"hair\": [\n        \"front_hair.png\"\n    ],\n    \"face\": [\n        \"normal.png\",\n        \"lough.png\"\n    ],\n    \"body\": [\n        \"body.png\",\n        \"body_b.png\"\n    ]\n}\n\n\/\/ \u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\nconsole.log(\"# loading \" + file_path)\nvar psd = PSD.fromFile(file_path);\n\n\/\/ psd\u306eparse\u51e6\u7406\nvar data = null;\n\ntry {\n    psd.parse();\n    data = psd.tree().export();\n} catch (e) {\n    console.error(\"[ERROR] parsing file failed: \" + file);\n    return;\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ validation\u5b9f\u65bd\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\/\/ \u7a00\u306b\u540c\u3058\u30ec\u30a4\u30e4\u540d\u304c\u91cd\u8907\u3057\u3066\u3044\u308b\u3053\u3068\u3082\u3042\u308b\u306e\u3067\u30c1\u30a7\u30c3\u30af\u306f\u3044\u308c\u3066\u304a\u3053\u3046\uff01\nvar dupcheck = {};\ntraverse(data.children, function(layer, parent) {\n    if (parent == undefined) {\n        \/\/ \u89aa\u304c\u306a\u3044\u3001\u3068\u3044\u3046\u3053\u3068\u306ftoplevel\u306a\u306e\u3067\n        var failed = true;\n        for (var n in layerset_rules) {\n            if (layerset_rules[n] == layer.name) {\n                failed = false;\n                break;\n            }\n        }\n        \n        if (failed) {\n            console.error(\"[ERROR] \" + layer.name + \" doesn't match layerset rule\");\n            return false;\n        }\n    } else {\n        var failed = true;\n        for (var n in per_rules[parent.name]) {\n            if (per_rules[parent.name][n] == layer.name) {\n                failed = false;\n                break;\n            }\n        }\n        if (failed) {\n            console.error(\"[ERROR] \" + layer.name + \" doesn't match layer name rule\");\n            return false;\n        }\n    }\n    \n    return true;\n});\n\n\n\/\/ psd\u306e\u5de1\u56de\nfunction traverse(layers, callback, parent) {\n    for (var n in layers) {\n        \/\/ skip comment layer: #\u3082\u3057\u304f\u306f\uff03\u304c\u5148\u982d\u306e\u5834\u5408\u306f\u51e6\u7406\u3092\u30b9\u30ad\u30c3\u30d7\u3002\n        if (layers[n].name.indexOf(\"#\") == 0 || layers[n].name.indexOf(\"\uff03\") == 0) {\n            continue;\n        }\n        \n        \/\/ DEBUG\u7528\u306b\u540d\u524d\u3060\u3057\u3066\u304a\u3053\u3046\u3002\u5fc5\u8981\u306a\u3051\u308c\u3070\u524a\u3063\u3066\u306d\u3002\n        console.log(\"# \" + layers[n].name);\n        \n        \/\/ \u76f4\u524d\u306e\u89aa\u307e\u3067\u3057\u304b\u3068\u3063\u3066\u306a\u3044\u306e\u3067\u5fc5\u8981\u304c\u3042\u308c\u3070\u3088\u3057\u306a\u306b\n        if (callback(layers[n], parent) == false) {\n            \/\/ failed: \u30a8\u30e9\u30fc\u898b\u3064\u3051\u3066\u3082\u7d9a\u884c\u3057\u305f\u3044\u5834\u5408\u306freturn\u3092\u5916\u305d\u3046\u3002\n            return;\n        }\n\n        if (!dupcheck[layers[n].name]) {\n            \/\/\u91cd\u8907\u30c1\u30a7\u30c3\u30af\u3082\u3084\u3063\u3066\u304a\u304f\u3068\u3044\u3044\u3088\uff01\n            dupcheck[layers[n].name] = true;\n        } else {\n            console.error(\"[ERROR] found duplicated: \" + layers[n].name);\n        }\n        \n        if (layers[n].children != undefined) {\n            traverse(layers[n].children, callback, layers[n])\n        }\n    }\n}\n<\/pre>\n<p>\u4eca\u56de\u306f\u30b5\u30f3\u30d7\u30eb\u306a\u3093\u3067\u3053\u3093\u306a\u3093\u3067\u5341\u5206\u3067\u3057\u3087\u3046\u3002<\/p>\n<h3>\u5b9f\u884c<\/h3>\n<p>\u305d\u308c\u3067\u306f\u30b3\u30fc\u30c9\u66f8\u304d\u7d42\u308f\u3063\u305f\u306e\u3067\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre>\n# package.json\u306b\u304b\u304b\u308c\u305fdependencies\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb(\u521d\u56de\u306e\u307f)\nnpm install\n# \u5b9f\u969b\u306b\u30eb\u30fc\u30eb\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\nnode validate.js example.psd\n<\/pre>\n<p>\u51fa\u529b\u5185\u5bb9<\/p>\n<pre>\n# loading C:\\Users\\chobie\\Desktop\\validate\\example.psd\n# hair\n# front_hair.png\n# face\n# lough.png\n# normal.png\n# body\n# body_\uff42.png\n[ERROR] body_\uff42.png doesn't match layer name rule\n# body\n[ERROR] found duplicated: body\n<\/pre>\n<p>\u304a\u30fc\u3063\u3068\u3001body_b.png\u3067\u3042\u308b\u3068\u3053\u308d\u304c\u5168\u89d2\u306e\uff42\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002<br \/>\n\u3064\u3044\u3067\u306bbody\u3068\u3044\u3046\u30ec\u30a4\u30e4\u30bb\u30c3\u30c8\u304c\u91cd\u8907\u3057\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306fpsd\u3092\u306a\u304a\u3057\u3066\u30ea\u30c8\u30e9\u30a4\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre>\nnode validate.js example.psd\n\n# loading C:\\Users\\chobie\\Desktop\\validate\\example2.psd\n# hair\n# front_hair.png\n# face\n# lough.png\n# normal.png\n# body\n# body_b.png\n# body.png\n<\/pre>\n<p>\u4eca\u5ea6\u306f\u30c7\u30d0\u30c3\u30b0\u7528\u306e\u8868\u793a\u306e\u307f\u3067\u3001\u7279\u306b\u30a8\u30e9\u30fc\u304c\u3067\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u81ea\u52d5\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3044\u30ec\u30a4\u30e4\u540d\u79f0\u90e8\u5206\u306e\u30c1\u30a7\u30c3\u30af\u304c\u3067\u304d\u3066\u3044\u307e\u3059\u306d\uff01<\/p>\n<h3>\u307e\u3068\u3081<\/h3>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001node.js\u3068PSD.js\u3092\u4f7f\u3063\u3066psd\u30d5\u30a1\u30a4\u30eb\u306e\u30ec\u30a4\u30e4\u30bb\u30c3\u30c8\u306e\u30eb\u30fc\u30eb\u30c1\u30a7\u30c3\u30af\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u7c21\u6613\u306a\u8aac\u660e\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u4f7f\u3063\u3066\u307f\u308b\u307e\u3067\u306e\u53d6\u3063\u639b\u304b\u308a\u306b\u306f\u306a\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u5b9f\u7528\u3059\u308b\u5834\u5408\u306f\u767a\u6ce8\u3001\u7d0d\u54c1\u3001\u691c\u54c1\u30d5\u30ed\u30fc\u306a\u3069\u3082\u52a0\u5473\u3057\u3064\u3064\u3069\u3053\u306b\u306a\u3093\u306e\u30c1\u30a7\u30c3\u30af\u3092\u631f\u3080\u306e\u304b\u3001\u3068\u3044\u3046\u5224\u65ad\u3092\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u6bce\u56de\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u624b\u52d5\u3067\u5b9f\u884c\u3059\u308b\u306e\u306f\u624b\u9593\u306a\u306e\u3067\u3001\u5927\u62b5\u306e\u5834\u5408\u6307\u5b9a\u306e\u30d5\u30a1\u30a4\u30eb\u7f6e\u304d\u5834\u306b\u30d5\u30a1\u30a4\u30eb\u304c\u914d\u7f6e\u3055\u308c\u305f\u3089\u81ea\u52d5\u3067kick\u3057\u3066\u30c1\u30a7\u30c3\u30af\u5b9f\u65bd\u3084\u554f\u984c\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306e\u901a\u77e5\u306a\u3069\u306e\u51e6\u7406\u3092\u306f\u3055\u3093\u3067\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u3059\u3054\u304f\u5730\u5473\u306a\u51e6\u7406\u3067\u76ee\u7acb\u305f\u306a\u3044\u90e8\u5206\u3067\u3059\u304c\u3001\u3053\u3046\u3044\u3063\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u51e6\u7406\u304c\u3067\u304d\u308b\u90e8\u5206\u3092\u7a4d\u6975\u7684\u306b\u81ea\u52d5\u5316\u3057\u3066\u3044\u3051\u3070\u30c1\u30a7\u30c3\u30af\u62c5\u5f53\u306e\u8ca0\u62c5\u304c\u6e1b\u3063\u3066\u672c\u6765\u6ce8\u529b\u3059\u3079\u304d\u30b2\u30fc\u30e0\u958b\u767a\u90e8\u5206\u306b\u529b\u304c\u6ce8\u3052\u307e\u3059\u3002<\/p>\n<p>\u3053\u3046\u3044\u3063\u305f\u7d30\u304b\u3044\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3042\u308c\u3070\u7247\u624b\u9593\u3067\u3084\u308c\u308b\u7bc4\u56f2\u3067\u3059\u3057\u3001\u304c\u3063\u3064\u308a\u7d44\u307e\u306a\u3051\u308c\u3070\u5f8c\u8150\u308c\u3082\u5c11\u306a\u3044\u306e\u3067\u3001\u5e38\u65e5\u9803\u304b\u3089\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8\u304c\u4f7f\u3046\u30c4\u30fc\u30eb\u3092\u3044\u3058\u3063\u305f\u308a\u96d1\u8ac7\u3057\u3066\u4f55\u3092\u3084\u308c\u3070\u30c1\u30fc\u30e0\u3084\u30e1\u30f3\u30d0\u30fc\u304c\u3069\u3046\u3044\u3046\u65b9\u5411\u3092\u76ee\u6307\u305b\u308b\u306e\u304b\u3001\u3068\u3044\u3046\u306e\u3092\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u90e8\u5206\u304b\u3089\u8003\u3048\u308b\u3068\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n(\u9905\u306f\u9905\u5c4b\u306a\u3093\u3067\u62c5\u5f53\u306e\u65b9\u304c\u5c45\u3066\u304f\u308c\u305f\u3089\u304a\u307e\u304b\u305b\u3057\u3061\u3083\u3046\u90e8\u5206\u3067\u306f\u3042\u308a\u307e\u3059\u304c)<\/p>\n<p>\u305d\u308c\u3067\u306f\u3088\u3044\u958b\u767a\u3092\uff5e<\/p>\n<h3>\u88dc\u8db3<\/h3>\n<p>\u30fb\u81ea\u5206\u304c\u4f7f\u3063\u305f\u4e2d\u3067\u306fPSD.js\u304c\u4e00\u756a\u624b\u3063\u53d6\u308a\u65e9\u304f\u6587\u5b57\u30b3\u30fc\u30c9\u95a2\u9023\u306e\u554f\u984c\u3082\u306a\u304f\u52d5\u4f5c\u3055\u305b\u3089\u308c\u307e\u3057\u305f<br \/>\n\u30fbjsx\u306f\u5916\u90e8\u95a2\u9023\u306e\u3084\u308a\u3068\u308a\u3092\u3057\u59cb\u3081\u308b\u3068\u3060\u3044\u3076\u8f9b\u3044\u3082\u306e\u304c\u3042\u308b\u306e\u3067\u4ed6\u306e\u8a00\u8a9e\u4f7f\u3063\u3066\u64cd\u4f5c\u3057\u305f\u307b\u3046\u304c\u826f\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\uff08\u500b\u4eba\u7684\u306b\uff09<br \/>\n\u3000\u30fb\u5909\u63db\u7cfb\u306e\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u306f\u5916\u90e8\u30c4\u30fc\u30eb\u3060\u3068\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u306a\u3044\u6a5f\u80fd\u304c\u3042\u3063\u305f\u308a\u3059\u308b\u306e\u3067Photoshop\u3092\u64cd\u4f5c\u3059\u308b\u7cfb\u306e\u307b\u3046\u304c\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8\u3068\u540c\u3058\u4f5c\u696d\u304c\u518d\u73fe\u3057\u3084\u3059\u3044\u306e\u3067\u90fd\u5408\u826f\u3044\u3067\u3059\u3002psdparse\u3068\u304b\u3082\u4fbf\u5229\u3067\u3059\u304c\u9069\u6750\u9069\u6240<br \/>\n\u30fb\u306a\u3093\u304b\u3088\u304f\u308f\u304b\u3089\u3093\u3053\u3068\u3042\u3063\u305f\u3089twitter\u306echobi_e\u307e\u3067\u304a\u6c17\u8efd\u306b\u3069\u3046\u305e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3054\u3076\u3055\u305f\u3057\u3066\u304a\u308a\u307e\u3059\u3002\u3061\u3087\u3073\u3048\u3067\u3059\u3002 \u6700\u8fd1\u306fblender2.8\u306e\u30d9\u30fc\u30bf\u304c\u51fa\u59cb\u3081\u305f\u306e\u3067\u30e2\u30c7\u30ea\u30f3\u30b0\u3084\u3089\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3084\u3063\u3066\u904a\u3093\u3067\u3044\u307e\u3059\u3002 \u524d\u3005\u304b\u3089ZBrush\u3084\u3089houdini\u3067\u904a\u3093\u3067\u307e\u3057\u305f\u304c\u3001\u30dd\u30ea\u30b4\u30f3\u30d5\u30ed\u30fc\u306e\u826f\u3057\u60aa\u3057\u3068\u304b\u8a00 [&hellip;]<\/p>\n","protected":false},"author":100,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[158],"class_list":["post-17711","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-photoshop"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/17711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/users\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/comments?post=17711"}],"version-history":[{"count":3,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/17711\/revisions"}],"predecessor-version":[{"id":17781,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/posts\/17711\/revisions\/17781"}],"wp:attachment":[{"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/media?parent=17711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/categories?post=17711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labs.gree.jp\/blog\/wp-json\/wp\/v2\/tags?post=17711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}