<?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[lhit from BaseVolumeData]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I've been trying to understand what type of structure I would need to be able to access what lhit offers, although I know what a PyCobject is, I still don't understand what structure I should use, or what data it affords me, I reviewed the C++ documentation but ended up with more questions than answers, I work in python in a simple sahder, I really don't plan anything elaborate and at this point I'm just testing what information I can get to identify what will be useful to me, I would appreciate it if someone could help me with this problem</p>
<pre><code>import ctypes
import c4d

PyCObject_AsVoidPtr = ctypes.pythonapi.PyCObject_AsVoidPtr 
PyCObject_AsVoidPtr.restype = ctypes.c_void_p
PyCObject_AsVoidPtr.argtypes = [ctypes.py_object]

def Message(sh, msg, data):
    return True
 
def InitRender(sh, irs, customdata): 
    return c4d.INITRENDERRESULT_OK
 
def FreeRender(sh, customdata): 
    pass 
once = True
def Output(sh, cd, customdata):
    global once
    if not cd.vd: 
        return c4d.Vector(0) 

    pyco = cd.vd.lhit
    if not pyco:
        return c4d.Vector(0)

    if once:
        ptr = PyCObject_AsVoidPtr(pyco)
        
        print (ptr)
        
        once = False
        
                
    return c4d.Vector(0) 
</code></pre>
<p dir="auto">I experimented with the PyCObjects of the PolygonObjects and managed to obtain information from the indices. It is not useful to me, but I wanted to know first if it was possible, but I require prior knowledge of the information I hope to obtain. In this case, I feel blind, I would appreciate it if someone would light my way.<br />
thanks in advance<br />
JH</p>
]]></description><link>http://developers.maxon.net/forum/topic/16203/lhit-from-basevolumedata</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 22:47:32 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/16203.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Apr 2025 00:23:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to lhit from BaseVolumeData on Thu, 01 May 2025 02:48:29 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/m_adam">@<bdi>m_adam</bdi></a>,<br />
Thanks for the reply! What you’re saying makes a lot of sense C++ is clearly the better option for this kind of stuff, especially when you need more control and better performance. I haven’t had much chance to dive into C++ yet, but I’m well aware it’s way more powerful than Python when it comes to working with the engine.<br />
It’s a bit of a shame that there’s no way to directly access polygon info from Python, since that’s exactly what I needed. But still, I really appreciate you taking the time to explain it.<br />
Cheers,<br />
James H.</p>
]]></description><link>http://developers.maxon.net/forum/post/76386</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/76386</guid><dc:creator><![CDATA[JH23]]></dc:creator><pubDate>Thu, 01 May 2025 02:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to lhit from BaseVolumeData on Tue, 29 Apr 2025 20:24:06 GMT]]></title><description><![CDATA[<p dir="auto">Hi sadly there is not much you can do with it in Python. The only use case is if your want to create a kind of hashmap on the pointer, but I do not see a big use case of that to be honest. I will see if I can improve thing a bit here, because in C++ via the lhit you can retrieve the polygon and the underlying object being hit, which is important information but this is very low on my priority list. So in general regarding shader I would say you better at look at C++ since in any case doing a Shader in Python will most likely be a performance killer.</p>
<p dir="auto">Cheers,<br />
Maxime.</p>
]]></description><link>http://developers.maxon.net/forum/post/76375</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/76375</guid><dc:creator><![CDATA[m_adam]]></dc:creator><pubDate>Tue, 29 Apr 2025 20:24:06 GMT</pubDate></item></channel></rss>