{"id":177,"date":"2025-03-18T20:02:16","date_gmt":"2025-03-18T11:02:16","guid":{"rendered":"https:\/\/cg-method.com\/photoshop\/?p=177"},"modified":"2025-03-18T20:04:09","modified_gmt":"2025-03-18T11:04:09","slug":"toggle-back-ground-layer","status":"publish","type":"post","link":"https:\/\/cg-method.com\/photoshop\/toggle-back-ground-layer\/","title":{"rendered":"Photoshop\u30b9\u30af\u30ea\u30d7\u30c8\uff08jsx\uff09\u2502\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u306e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>Photoshop\u3067 <strong>\u4e00\u756a\u4e0b\u306e\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u306e\u8868\u793a\u3092ON\/OFF\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/strong> \u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u3092\u30c8\u30b0\u30eb\u3059\u308b\u3053\u3068\u3067\u3001 <strong>\u30c7\u30b6\u30a4\u30f3\u306e\u78ba\u8a8d\u4f5c\u696d\u3092\u52b9\u7387\u5316<\/strong> \u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"380\" height=\"246\" src=\"https:\/\/cg-method.com\/photoshop\/wp-content\/uploads\/2025\/03\/toggle.gif\" alt=\"\" class=\"wp-image-178\"\/><\/figure>\n\n\n\n<p class=\"is-style-icon_pen\">\u203b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u30e9\u30f3\u30c1\u30e3\u30fc\u306f\u672c\u8a18\u4e8b\u306b\u306f\u3042\u308a\u307e\u305b\u3093<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3059\u308b\u30e1\u30ea\u30c3\u30c8<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4e00\u756a\u4e0b\u306e\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u3092\u30ef\u30f3\u30af\u30ea\u30c3\u30af\u3067\u8868\u793a\/\u975e\u8868\u793a\u306b\u5207\u308a\u66ff\u3048<\/strong><\/li>\n\n\n\n<li><strong>\u4f5c\u696d\u4e2d\u306b\u7d20\u65e9\u304f\u80cc\u666f\u306e\u78ba\u8a8d\u304c\u53ef\u80fd<\/strong><\/li>\n\n\n\n<li><strong>\u624b\u4f5c\u696d\u306e\u5207\u308a\u66ff\u3048\u3092\u81ea\u52d5\u5316\u3067\u304d\u308b<\/strong><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u306e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">STEP.1 \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u683c\u7d0d<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>ToggleBackGroundLayer.jsx<\/code> \u3068\u3044\u3046\u540d\u524d\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4fdd\u5b58\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>ToggleBackGroundLayer.jsx<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>var layObj = activeDocument.artLayers;\nvar bgLayer = layObj[layObj.length-1]; \/\/ \u4e00\u756a\u4e0b\u306e\u30ec\u30a4\u30e4\u30fc\n\nif(bgLayer.isBackgroundLayer){    \n    bgLayer.name = &quot;\u80cc\u666f&quot;; \/\/ \u30ea\u30cd\u30fc\u30e0\u3057\u3066\u80cc\u666f\u3092\u5909\u63db\n    toggleBackGroundLayer();\n} else {\n    toggleBackGroundLayer();\n}\n\n\/\/ \u4e00\u756a\u4e0b\u306e\u30ec\u30a4\u30e4\u30fc\u306e\u8868\u793a\u3092\u30c8\u30b0\u30eb\nfunction toggleBackGroundLayer(){  \n    if(bgLayer.visible){\n        bgLayer.visible = false;\n    } else {\n        bgLayer.visible = true;\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4ee5\u4e0b\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u79fb\u52d5\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>C:\\Program Files\\Adobe\\Adobe Photoshop CC\\Presets\\Scripts\\<\/code><\/pre><\/div>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Photoshop\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">STEP.2 \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>[\u30d5\u30a1\u30a4\u30eb]<\/strong> \u2192 <strong>[\u30b9\u30af\u30ea\u30d7\u30c8]<\/strong> \u2192 <strong>[ToggleBackGroundLayer]<\/strong> \u3092\u5b9f\u884c\u3002<\/li>\n\n\n\n<li><strong>\u4e00\u756a\u4e0b\u306e\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u304cON\/OFF\u3067\u5207\u308a\u66ff\u308f\u308a\u307e\u3059\u3002<\/strong><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4e00\u756a\u4e0b\u306e\u30ec\u30a4\u30e4\u30fc\u304c\u30ef\u30f3\u30bf\u30c3\u30d7\u3067\u8868\u793a\/\u975e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048<\/strong><\/li>\n\n\n\n<li><strong>\u80cc\u666f\u3092\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u3067\u30c7\u30b6\u30a4\u30f3\u306e\u8996\u8a8d\u6027\u3092\u5411\u4e0a<\/strong><\/li>\n\n\n\n<li><strong>Photoshop\u306e\u624b\u4f5c\u696d\u3092\u6e1b\u3089\u3057\u3066\u3001\u52b9\u7387\u7684\u306b\u4f5c\u696d\u53ef\u80fd<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Photoshop\u306e\u4f5c\u696d\u3092\u30b9\u30e0\u30fc\u30ba\u306b\u3059\u308b\u305f\u3081\u306b\u3001 <strong>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u6d3b\u7528\u3057\u3066\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u306e\u7ba1\u7406\u3092\u7c21\u5358\u306b<\/strong> \u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>Photoshop\u3067 \u4e00\u756a\u4e0b\u306e\u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u306e\u8868\u793a\u3092ON\/OFF\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8 \u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u80cc\u666f\u30ec\u30a4\u30e4\u30fc\u3092\u30c8\u30b0\u30eb\u3059\u308b\u3053\u3068\u3067\u3001 \u30c7\u30b6\u30a4\u30f3\u306e\u78ba\u8a8d\u4f5c\u696d\u3092\u52b9\u7387\u5316 \u3067\u304d\u307e\u3059\u3002 \u203b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u30e9\u30f3\u30c1\u30e3\u30fc\u306f\u672c\u8a18\u4e8b\u306b\u306f\u3042\u308a\u307e\u305b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":179,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[2],"tags":[9],"class_list":["post-177","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-layer-operation","tag-free"],"_links":{"self":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":2,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":181,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/posts\/177\/revisions\/181"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media\/179"}],"wp:attachment":[{"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cg-method.com\/photoshop\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}