Error with TraceFilterSimple()

Please post any questions about developing your plugin here. Please use the search function before posting!
rovizon
Junior Member
Posts: 22
Joined: Mon May 31, 2021 3:01 pm
Location: Donbass

Error with TraceFilterSimple()

Postby rovizon » Sat Jun 05, 2021 8:08 pm

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?
User avatar
L'In20Cible
Project Leader
Posts: 1534
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Error with TraceFilterSimple()

Postby L'In20Cible » Sun Jun 06, 2021 1:14 am

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
rovizon
Junior Member
Posts: 22
Joined: Mon May 31, 2021 3:01 pm
Location: Donbass

Re: Error with TraceFilterSimple()

Postby rovizon » Sun Jun 06, 2021 7:07 am

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!

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 25 guests