Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I implement LiveEffect with rasterization?

Community Beginner ,
Feb 13, 2025 Feb 13, 2025

Hello! I am currently doing research on implementing LiveEffectPlugin in Deno (https://deno.com/) and I am strongly seeking information on LiveEffect with rasterization.

 

The LiveEffect built into Illustrator implements things like “rasterize”, “blur”, and “drop shadow” that involve rasterization processing, but I am having trouble finding examples of implementing such effects. (Even after searching through the SDK documentation, open source projects on GitHub, and other references)

 

Does anyone know how to do this?

 

The GoLiveEffect method of the plugin has been implemented so far, but the set pixels are not reflected on the screen. (To make it easier to understand the result, I have made the bonding box red.)

```

ASErr HelloWorldPlugin::GoLiveEffect(AILiveEffectGoMessage *message)

{

    ASErr error = kNoErr;

    PluginParams params;

    this->getDictionaryValues(message->parameters, params);

    

    try {

        AIArtHandle art = message->art;

   

        AIArtSet artSet;

        error = sAIArtSet->NewArtSet(&artSet); CHKERR;

        error = sAIArtSet->AddArtToArtSet(artSet, art); CHKERR;

 

        AIRasterizeSettings settings;

        settings.type = kRasterizeARGB;

        settings.resolution = 300.0;

        settings.antialiasing = 4;

        settings.options = kRasterizeOptionsNone;

        settings.preserveSpotColors = false;

       

        AIRealRect bounds;

        error = sAIRasterize->ComputeArtBounds(artSet, &bounds, false); CHKERR;

 

        AIArtHandle rasterArt;

        AIRasterRecord rasterRecord;

       

        error = sAIRasterize->Rasterize(artSet, &settings, &bounds,

                                      kPlaceAbove, art, &rasterArt, NULL); CHKERR;

        error = sAIRaster->GetRasterInfo(rasterArt, &rasterRecord); CHKERR;

        

        std::cout << rasterRecord.bounds.top << " "

            << rasterRecord.bounds.right << " "

            << rasterRecord.bounds.bottom << " "

            << rasterRecord.bounds.left << std::endl;

 

        ai::uint32 width = rasterRecord.bounds.right - rasterRecord.bounds.left;

        ai::uint32 height = rasterRecord.bounds.bottom - rasterRecord.bounds.top;

        

        AISlice artSlice = {0, 0, static_cast<ai::int32>(width), static_cast<ai::int32>(height), 0, 4};

        AISlice workSlice = artSlice;

        

        // !! THIS IS NOT WORKING (No any appearance changed) !! //

        AITile workTile;

        error = sAIRaster->GetRasterTile(rasterArt, &artSlice, &workTile, &workSlice); CHKERR;

        

        for(ai::uint32 i = 0; i < width * height * 4; i += 4) {

           static_cast<ai::uint8*>(workTile.data)[i] = 255;     // Red

           static_cast<ai::uint8*>(workTile.data)[i+1] = 0;     // Green

           static_cast<ai::uint8*>(workTile.data)[i+2] = 0;     // Blue

           static_cast<ai::uint8*>(workTile.data)[i+3] = 255;   // Alpha

        }

 

        error = sAIRaster->SetRasterTile(rasterArt, &artSlice, &workTile, &workSlice);

        delete[] static_cast<ai::uint8*>(workTile.data);

        message->art = rasterArt;

        // !! THIS IS NOT WORKING (No any appearance changed) !! //

        

        sAIArtSet->DisposeArtSet(&artSet);

    } catch (...) {

        

    }

    

    return error;

}

```

 

Regards

TOPICS
SDK
328
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jul 05, 2025 Jul 05, 2025

I apologize, but I have forgotten the details. However, I will leave a link to the relevant process for the plugin that works.

https://github.com/hanakla/illustrator-webgpu-plugin/blob/main/pkgs/plugin/Source/AiDenoPlugin.cpp#L207

Translate
Adobe
Community Beginner ,
Mar 17, 2025 Mar 17, 2025

Sorry this problem solved!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 31, 2025 Mar 31, 2025

How did you solve it?

 

Many thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 05, 2025 Jul 05, 2025
LATEST

I apologize, but I have forgotten the details. However, I will leave a link to the relevant process for the plugin that works.

https://github.com/hanakla/illustrator-webgpu-plugin/blob/main/pkgs/plugin/Source/AiDenoPlugin.cpp#L...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines