<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to draw svg to bitmaps?]]></title><description><![CDATA[<p dir="auto">Hey community,</p>
<p dir="auto">I want to display capsule assets with icon with <code>maxon.AssetUtilitiesInterface.GetAssetIcon</code> , but some of the icon is in svg format, can we draw this into a bitmap like <code>command palate</code> did?</p>
<pre><code class="language-python">import c4d
import maxon

doc: c4d.documents.BaseDocument  # The currently active document.
op: c4d.BaseObject | None  # The primary selected object in `doc`. Can be `None`.

def main() -&gt; None:
    """Called by Cinema 4D when the script is being executed.
    """
    repo = maxon.AssetInterface.GetUserPrefsRepository()
    uid = maxon.Id("file_bc73b379cb5e509e")
    # this is the ivy capsule id, it has a svg icon
    # uid = maxon.Id("com.rocketlasso.neutron.asset.generator.ivy")

    asset_description = repo.FindLatestAsset(
        maxon.AssetTypes.File(), uid, maxon.Id(), maxon.ASSET_FIND_MODE.LATEST)
    preview_url = maxon.AssetUtilitiesInterface.GetAssetIcon(asset_description)
    bmp = c4d.bitmaps.BaseBitmap()
    result, _ = bmp.InitWith(preview_url)
    if result != c4d.IMAGERESULT_OK:
        return None
    c4d.bitmaps.ShowBitmap(bmp)

if __name__ == '__main__':
    main()
</code></pre>
<p dir="auto">Cheers~<br />
DunHou</p>
]]></description><link>http://developers.maxon.net/forum/topic/16415/how-to-draw-svg-to-bitmaps</link><generator>RSS for Node</generator><lastBuildDate>Fri, 16 Oct 2026 11:42:43 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/16415.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 May 2026 03:57:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to draw svg to bitmaps? on Mon, 01 Jun 2026 09:56:12 GMT]]></title><description><![CDATA[<p dir="auto">I started to work last Friday on a <code>BaseBitmap.InitWithVectorImage</code>. It will for sure not make it into the next release of Cinema 4D, as we are too close to that, and I cannot make any promises when or if it will arrive. But I see value in this especially since I realized that you cannot even really use this in C++, as <code>VectorImageInterface</code> requires access to some internal components to be rasterized.</p>
]]></description><link>http://developers.maxon.net/forum/post/77177</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/77177</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Mon, 01 Jun 2026 09:56:12 GMT</pubDate></item><item><title><![CDATA[Reply to How to draw svg to bitmaps? on Sat, 30 May 2026 15:33:50 GMT]]></title><description><![CDATA[<p dir="auto">Well, that's exactly what I'm worried about. I try my best to avoid introducing third-party libraries, but currently it seems that I can only use resvg or pillow.</p>
<p dir="auto">Cheers~<br />
DunHou.</p>
]]></description><link>http://developers.maxon.net/forum/post/77176</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/77176</guid><dc:creator><![CDATA[Dunhou]]></dc:creator><pubDate>Sat, 30 May 2026 15:33:50 GMT</pubDate></item><item><title><![CDATA[Reply to How to draw svg to bitmaps? on Fri, 29 May 2026 12:58:27 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/dunhou">@<bdi>Dunhou</bdi></a>,</p>
<p dir="auto">Thank you for reaching out to us. I am afraid that this is not possible within our Python API at the moment.</p>
<p dir="auto">Internally, <code>BaseBitmap</code> is what we call an adapter. It is a hollowed out type from older days, which only continues to exist so that we do not have to rewrite large parts of our code base. A <code>BaseBitmap</code> wraps internally an <code>ImageInterface</code>, where also the sub-type <a href="https://developers.maxon.net/docs/cpp/2026_2_0/classmaxon_1_1_vector_image_interface.html#af02f2a0335e1a61147dce2afe62c1347" target="_blank" rel="noopener noreferrer nofollow ugc">VectorImageInterface</a> exists. Unfortunately, neither of these Maxon API interfaces are exposed to Python, and it is also somewhat unlikely that they will be in the future. The reason why your code <code>bmp.InitWith(preview_url)</code> does not work, is because the backend function <code>::InitFromFile</code> which implements <code>BaseBitmap::InitWith</code> operates based on <a href="https://developers.maxon.net/docs/py/2026_2_0/modules/c4d.plugins/BaseData/BitmapLoaderData/index.html" target="_blank" rel="noopener noreferrer nofollow ugc">bitmap loaders</a> and <code>VectorImageInterface</code> is not a bitmap loader, because it was implemented long after the 'classic' Cinema API.</p>
<p dir="auto">When I have some time, I will try to monkey patch a <code>BaseBitmap.FromVectorImage</code> method into the Python API. For now, you would have to use an external library such as Pillow.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/77175</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/77175</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Fri, 29 May 2026 12:58:27 GMT</pubDate></item></channel></rss>