Page 1 of 1

Error with TraceFilterSimple()

Posted: Sat Jun 05, 2021 8:08 pm
by rovizon
Hello. When I am trying to create a trace with TraceFilterSimple() to ignore one entity I get error:

Syntax: Select all

File "..\addons\source-python\packages\source-python\engines\trace.py", line 207, in __init__
self.ignore = set(map(inthandle_from_baseentity, ignore))

TypeError: No registered converter was able to extract a C++ pointer to type class CBaseEntityWrapper from this Python object of type int


Syntax: Select all

ray = Ray(start_pos, end_pos)
trace = GameTrace()
engine_trace.trace_ray(
ray,
ContentMasks.ALL,
TraceFilterSimple(ignore=(entity.index, )),
trace
)


What am I doing wrong?

Re: Error with TraceFilterSimple()

Posted: Sun Jun 06, 2021 1:14 am
by L'In20Cible
The following:

Syntax: Select all

TraceFilterSimple(ignore=(entity.index, )),

Should be:

Syntax: Select all

TraceFilterSimple(ignore=(entity, )),

Seems like the docstring was forgotten, but this was changed into the following commit: https://github.com/Source-Python-Dev-Te ... 0b66806ee9

Re: Error with TraceFilterSimple()

Posted: Sun Jun 06, 2021 7:07 am
by rovizon
L'In20Cible wrote:The following:

Syntax: Select all

TraceFilterSimple(ignore=(entity.index, )),

Should be:

Syntax: Select all

TraceFilterSimple(ignore=(entity, )),

Seems like the docstring was forgotten, but this was changed into the following commit: https://github.com/Source-Python-Dev-Te ... 0b66806ee9


It works. Thanks!