# Critical Bug at "make Shape from path"

**URL:** https://forums.creativeclouddeveloper.com/t/critical-bug-at-make-shape-from-path/2368
**Category:** Photoshop
**Tags:** bug
**Created:** [December 21, 2020, 7:08pm UTC](https://forums.creativeclouddeveloper.com/t/critical-bug-at-make-shape-from-path/2368 "2020-12-21T19:08:35Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![simonhenke](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/simonhenke/32/957_2.png) [@simonhenke](https://forums.creativeclouddeveloper.com/u/simonhenke)
#### Post date: [December 21, 2020, 7:08pm UTC](https://forums.creativeclouddeveloper.com/t/critical-bug-at-make-shape-from-path/2368/1 "2020-12-21T19:08:35Z")

</div>

A little heads-up for everyone using paths in their plugins: In one of the recent updates of Photoshop, a new bug crept in that made my whole plugin malfunction and gave me quite a bit of headaches to find and work around.

If you want to create a new shape using the work path, you’d usually use the following descriptor:

```
const desc = {
  _obj: 'make',
  _target:{
      _ref: 'contentLayer',
  },
  using: {
    _obj: 'contentLayer',
    type: {
      _obj: 'solidColorLayer',
      color: {
        _obj: 'RGBColor',
        red: 0,
        grain: 0,
        blue: 0,
      }
    },
    shape: {
      _obj: 'pathClass',
      targetPath: {
        _enum: 'pathKind',
        _value: 'targetPath',
      },
    },
  },
}

```

This does not work correctly anymore. Instead of using the target path (workpath), it just creates a new shape layer with an empty vector mask. When I built the plugin a few weeks ago, this bug didn’t exist.  
(I’m now on version 22.1.0 20201125.r.94 where the bug exists)

Also, this bug is not just related to UXP/scripting. Recording the mentioned event in a Photoshop Action and playing that one back gives the same incorrect result.

For now, I’ve come up with the following workaround:

```
require(photoshop).action.batchPlay(workPathToShape, {})

function workPathToShape(color: Color): ActionDescriptor[] {
  return [
    __makeShapeFromPath(color), // usually this would be enough
    __deleteActiveVectorMask(),
    __selectWorkPath(),
    __makeVectorMaskFromActivePath(),
  ];
}

function __makeShapeFromPath(color: Color): ActionDescriptor {
  return {
    _obj: "make",
    _target: {
      _ref: "contentLayer",
    },
    using: {
      _obj: "contentLayer",
      type: {
        _obj: "solidColorLayer",
        color,
      },
      shape: {
        _obj: "pathClass",
        targetPath: {
          _enum: "pathKind",
          _value: "targetPath",
        },
      },
    },
  };
}

function __selectWorkPath(): ActionDescriptor {
  return {
    _obj: "select",
    _target: { _ref: "path", _property: "workPath" },
  };
}

function __deleteActiveVectorMask(): ActionDescriptor {
  return {
    _obj: "delete",
    _target: { _ref: "path", _enum: "path", _value: "vectorMask" },
  };
}

function __makeVectorMaskFromActivePath(): ActionDescriptor {
  return {
    _obj: "make",
    _target: { _ref: "path" },
    at: { _ref: "path", _enum: "path", _value: "vectorMask" },
    using: { _ref: "path", _enum: "ordinal", _value: "targetEnum" },
  };
}

```

I think this bug is quite critical as it can cause various plugins, actions and scripts from the past to crash in the latest version of Photoshop…

---

<div class="post-metadata">

### Author: ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)
#### Post date: [December 21, 2020, 10:06pm UTC](https://forums.creativeclouddeveloper.com/t/critical-bug-at-make-shape-from-path/2368/2 "2020-12-21T22:06:07Z")

</div>

Are you sure? If you want to use work path you should reference work path and not selected path 🙂 At least if it can be used as a reference.

---

<div class="post-metadata">

### Author: ![simonhenke](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/simonhenke/32/957_2.png) [@simonhenke](https://forums.creativeclouddeveloper.com/u/simonhenke)
#### Post date: [December 21, 2020, 10:54pm UTC](https://forums.creativeclouddeveloper.com/t/critical-bug-at-make-shape-from-path/2368/3 "2020-12-21T22:54:25Z")

</div>

Yes I’m 99% sure. I think I even tried to reference the work path in that code.  
And the code has worked before, the Photoshop update definitely broke it.

To validate this behavior you could do the following:

1. Draw a path
2. Record action
3. Click the “Shape” button (at the top in the tool bar, when a path tool is selected)  
-\> Shape get’s created from the path
4. Stop recording
5. Undo a step
6. Play the recorded action

The results should be the same, but aren’t.

---

<div class="post-metadata">

### Author: ![Jarda](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/jarda/32/1909_2.png) [@Jarda](https://forums.creativeclouddeveloper.com/u/Jarda)
#### Post date: [December 21, 2020, 11:10pm UTC](https://forums.creativeclouddeveloper.com/t/critical-bug-at-make-shape-from-path/2368/4 "2020-12-21T23:10:55Z")

</div>

Ok thanks for the clarification. In this case, someone should fix it.

What if you record the action panel in old Photoshop and play in new Photoshop. Is that also broken?

---

<div class="post-metadata">

### Author: ![simonhenke](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/simonhenke/32/957_2.png) [@simonhenke](https://forums.creativeclouddeveloper.com/u/simonhenke)
#### Post date: [December 21, 2020, 11:34pm UTC](https://forums.creativeclouddeveloper.com/t/critical-bug-at-make-shape-from-path/2368/5 "2020-12-21T23:34:19Z")

</div>

Yes, that’s also broken.  
This definitely has to be seen by some Adobe devs, I might look for a better place to post this bug tomorrow as it’s not only related to plugin development.

---

<div class="post-metadata">

### Author: ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)
#### Post date: [December 22, 2020, 7:52am UTC](https://forums.creativeclouddeveloper.com/t/critical-bug-at-make-shape-from-path/2368/6 "2020-12-22T07:52:36Z")

</div>

I guess [this forum](https://community.adobe.com/t5/photoshop/bd-p/photoshop?page=1&sort=latest_replies&filter=all) would be the place

---

<div class="post-metadata">

### Author: ![simonhenke](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/simonhenke/32/957_2.png) [@simonhenke](https://forums.creativeclouddeveloper.com/u/simonhenke)
#### Post date: [December 22, 2020, 11:54am UTC](https://forums.creativeclouddeveloper.com/t/critical-bug-at-make-shape-from-path/2368/7 "2020-12-22T11:54:56Z")

</div>

Thanks, I’ve posted it [there](https://community.adobe.com/t5/photoshop/new-bug-quot-make-shape-from-path-quot-playback/m-p/11698937?page=1).

---

<div class="post-metadata">

### Author: ![JasonM](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@JasonM](https://forums.creativeclouddeveloper.com/u/JasonM)
#### Post date: [August 14, 2024, 1:25am UTC](https://forums.creativeclouddeveloper.com/t/critical-bug-at-make-shape-from-path/2368/8 "2024-08-14T01:25:39Z")

</div>

I am still seeing this on windows even in the beta.
