Skip to main content
itouh2@i0plus.jp
Participating Frequently
March 23, 2020
Answered

[Design]-CreateRenditions mask layer will output a transparent image in XD.

  • March 23, 2020
  • 2 replies
  • 819 views

Hello.
We're creating an exporter to Unity.
The output of the mask group.
It's not a masked image, it's a
I want to output a mask layer and an image layer separately.

You can add a mask layer to the API's CreateRenditions
The result is a transparent image.

Is this the expected behavior?
Is there a way around this?

This topic has been closed for replies.
Correct answer Peter Villevoye

This is typically not a quesion for a user forum like this.

However, your question/request is very clear and simple.

Have you checked it at https://adobexdplatform.com ?

2 replies

Peter Villevoye
Community Expert
Peter VillevoyeCommunity ExpertCorrect answer
Community Expert
March 27, 2020

This is typically not a quesion for a user forum like this.

However, your question/request is very clear and simple.

Have you checked it at https://adobexdplatform.com ?

itouh2@i0plus.jp
Participating Frequently
March 29, 2020

Thank you, Peter.
I'm not using the forums correctly.
I'll try to check and ask.

Harshika Verma
Community Manager
Community Manager
March 24, 2020

Hi there,

 

I am sorry I am unable to understand the issue you are facing. Is it possible for you to elaborate more about it with the help of a short video of your workflow for better understanding?

 

I will try my best to help.

 

Thanks,

Harshika

itouh2@i0plus.jp
Participating Frequently
March 26, 2020

Hello, Harshika.
Created a sample.

 

A mask-group consists of four colored boxes and a mask image of a circle.

 

Following plugin to output the image.
Outputs an image of the children of the selected group.

 

 

async function pluginRenditionChildren(selection, root) {
  const outputFolder = await fs.getFolder()

  if (!outputFolder) return console.log('User canceled folder picker.')

  let renditionOptions = []
  const length = selection.items[0].children.length
  for (let i = 0; i < length; i++) {
    const item = selection.items[0].children.at(i)
    const fileName = item.name + '.png'
    const file = await outputFolder.createFile(fileName, {
      overwrite: true,
    })
    renditionOptions.push({
      fileName: fileName,
      node: item,
      outputFile: file,
      type: application.RenditionType.PNG,
      scale: 1,
    })
    console.log(fileName)
  }

  const results = await application
    .createRenditions(renditionOptions)
    .catch(error => {
      console.log('exception:' + error)
      // https://forums.adobexdplatform.com/t/details-for-io-failed/1185/14
      // https://helpx.adobe.com/xd/kb/import-export-issues.html
      console.log(
        '1)access denied (disk permission)\n2)readonly folder\n3)not enough disk space\n4)maximum path\n5)image size 0px',
      )
    })
  console.log('done.')
}

 

 

 

The output image is as follows.

For the mask image, I would expect something like the following.


Being able to output a mask image makes it possible to apply it to other applications.

Please consider it.
Thank you.