Error cannot convert FillLayer to SmartObjectLayer

How can I convert a layer to smart object layer?

using (PsdImage psdImage = (PsdImage)Aspose.PSD.Image.Load(psdpath))
{
PsdImage duplicatePSD = psdImage;
SmartObjectLayer smartObject = (SmartObjectLayer)psdImage.Layers[1];
}

@mcjj23

At the moment, we only started to support Smart Objects. FillLayers are smart objects in common case. But they don’t inherit SmartObjectLayer class. In our roadmap we have this feature but not available at this very moment. Can you please share why actually you need this feature and provide us source file and desired output so that I may log that in our issue tracking system and we get back to you as soon as it will be addressed.

Hi, the reason why I need this feature is that I have some effects in my layer. But after I export them to png using the Save() function, the effects lost. So I figure there is a way around is to convert the layer to smart object layer first then export…
effectlost.zip (12.0 KB)

@mcjj23

I have created an issue with ID PSDNET-752 in our issue tracking system to further investigate your requirements and we will share the good news with you as soon as the issue will be fixed.

The issues you have found earlier (filed as PSDNET-752) have been fixed in this update.