Skip to main content
itouh2@i0plus.jp
Participating Frequently
Mar 23, 2020 9:38 AM UTC
Answered

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

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 is closed to new replies. Start a new post to keep the conversation going.
Peter Villevoye
Peter VillevoyeCorrect answer
Community Expert
Mar 27, 2020 12:55 PM UTC

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 ?

7 replies

Peter Villevoye
Community Expert
Peter VillevoyeCommunity ExpertCorrect answer
Community Expert
Mar 27, 2020 12:55 PM UTC

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 ?

Translate
itouh2@i0plus.jp
Participating Frequently
Mar 29, 2020 11:47 AM UTC

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

Translate
Harshika Verma
Community Manager
Community Manager
Mar 24, 2020 12:43 AM UTC

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

Translate
itouh2@i0plus.jp
Participating Frequently
Mar 26, 2020 2:12 AM UTC

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.

Translate