<?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[Can we draw alpha image in viewport]]></title><description><![CDATA[<p dir="auto">Hey,</p>
<p dir="auto">I want to draw images with alpha in viewport, but what I got is a image with black bg, I already test <code>DrawTexture</code> flag <code>DRAW_ALPHA_NORMAL_FROM_IMAGE</code> and <code>DRAW_ALPHA_FROM_IMAGE</code>, they will not work.</p>
<p dir="auto">Can I draw bitmaps with alpha in viewport, like the little icon under the mouse?</p>
<p dir="auto">Cheers~<br />
DunHou</p>
]]></description><link>http://developers.maxon.net/forum/topic/16412/can-we-draw-alpha-image-in-viewport</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 16:54:05 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/16412.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 May 2026 17:00:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can we draw alpha image in viewport on Tue, 19 May 2026 10:38:17 GMT]]></title><description><![CDATA[<p dir="auto">I do not think that <code>DRAW_ALPHA_FROM_IMAGE</code> should not work. I just picked <code>DRAW_ALPHA_NORMAL</code> because it is the "most default one" out of the <code>DRAW_ALPHA</code> flags. I will have a look later. But you can for now probably just use <code>DRAW_ALPHA_NORMAL</code>.</p>
]]></description><link>http://developers.maxon.net/forum/post/77167</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/77167</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Tue, 19 May 2026 10:38:17 GMT</pubDate></item><item><title><![CDATA[Reply to Can we draw alpha image in viewport on Tue, 19 May 2026 09:16:10 GMT]]></title><description><![CDATA[<p dir="auto">Sorry for my stupid question <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/ferdinand">@<bdi>ferdinand</bdi></a> , I should use <code>c4d.DRAW_ALPHA_NORMAL</code> but not <code>c4d.DRAW_ALPHA_FROM_IMAGE</code>.</p>
<p dir="auto">Shame on me <img src="http://developers.maxon.net/forum/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=0b8ddba251d" class="not-responsive emoji emoji-android emoji--joy" style="height:23px;width:auto;vertical-align:middle" title=":joy:" alt="😂" /></p>
<p dir="auto">Cheers~<br />
DunHou</p>
]]></description><link>http://developers.maxon.net/forum/post/77166</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/77166</guid><dc:creator><![CDATA[Dunhou]]></dc:creator><pubDate>Tue, 19 May 2026 09:16:10 GMT</pubDate></item><item><title><![CDATA[Reply to Can we draw alpha image in viewport on Tue, 19 May 2026 08:39:36 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/dunhou">@<bdi>Dunhou</bdi></a>,</p>
<p dir="auto">Can you please share code and possibly a <a href="https://developers.maxon.net/forum/topic/15244/support-procedures/5" target="_blank" rel="noopener noreferrer nofollow ugc">bug report</a>? Alphas with <code>DrawTexture</code> have a <a href="https://developers.maxon.net/forum/search?in=titlesposts&amp;term=DrawTexture%20alpha&amp;matchWords=all&amp;by=&amp;categories=&amp;searchChildren=false&amp;hasTags=&amp;replies=&amp;repliesFilter=atleast&amp;timeFilter=newer&amp;timeRange=&amp;sortBy=relevance&amp;sortDirection=desc&amp;showAs=posts" target="_blank" rel="noopener noreferrer nofollow ugc">troubled history</a> but when I tried in the <a href="https://github.com/Maxon-Computer/Cinema-4D-Python-API-Examples/blob/master/plugins/py-ocio_node_2025/py-ocio_node_2025.pyp" target="_blank" rel="noopener noreferrer nofollow ugc">py-ocio_node_2025 example</a> right now, it works for me.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
<h4>Result</h4>
<p dir="auto">We draw the little cube icon with alphas next to the existing drawing examples.<br />
<img src="/forum/assets/uploads/files/1779178220460-3e9a125b-4fce-495e-8d79-470a306b51b9-image-resized.png" alt="3e9a125b-4fce-495e-8d79-470a306b51b9-image.png" class=" img-fluid img-markdown" /></p>
<h4>Code</h4>
<p dir="auto">I just added the highlighted code in the <code>py-ocio_node_2025</code> example.<br />
<img src="/forum/assets/uploads/files/1779177757315-81d64c88-0967-41d2-8f90-2520431af192-image-resized.png" alt="81d64c88-0967-41d2-8f90-2520431af192-image.png" class=" img-fluid img-markdown" /></p>
<pre><code class="language-py">                # Draw the texture and a label for the flag below it.
                bd.DrawTexture(self._bitmap, points, texColors, texNormals, texUVs, 4, 
                               c4d.DRAW_ALPHA_NORMAL, flags)

                # --- new code: start ---
                
                icon: c4d.bitmaps.BaseBitmap | None = c4d.bitmaps.InitResourceBitmap(c4d.Ocube)
                if icon:
                    points: list[c4d.Vector] = [
                        c4d.Vector(xb, ya, 0),
                        c4d.Vector(xb + 20, ya, 0),
                        c4d.Vector(xb + 20, ya + 20, 0),
                        c4d.Vector(xb, ya + 20, 0)
                    ]

                    bd.DrawTexture(icon, points, texColors, texNormals, texUVs, 4, 
                                   c4d.DRAW_ALPHA_NORMAL, flags)

                # --- new code: end ---

                bd.DrawHUDText(xa, yb, "USE_PROFILE_COLOR" if isProfile else "NONE")
</code></pre>
<p dir="auto">edit: I made my changes <a href="https://github.com/Maxon-Computer/Cinema-4D-Python-API-Examples/blob/c42aa9df730a4145ceaf351cf6139d3efa48d537/plugins/py-ocio_node_2025/py-ocio_node_2025.pyp#L285" target="_blank" rel="noopener noreferrer nofollow ugc">part of the official code example</a>, as I thought it does not hurt to show that there too.</p>
]]></description><link>http://developers.maxon.net/forum/post/77165</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/77165</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Tue, 19 May 2026 08:39:36 GMT</pubDate></item></channel></rss>