Jump to content


Photo

Crash when running python script


  • Please log in to reply
2 replies to this topic

#1 VelvetFistIronGlove

VelvetFistIronGlove

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 23 November 2017 - 07:16 PM

I'm trying to write a couple of scripts to walk the graph and tweak every light entity. Trying to make sure the script will do the right thing first by just printing changes instead of making them. But DarkRadiant is crashing every time I run the script.

 

The script itself, the darkradiant log, a test map I had that it crashed on, and the crash dump itself are all at: https://www.dropbox...._crash.zip?dl=0

 

I'm running DarkRadiant version: 2.4.0 (x64) on Windows 10 64 bit. I'm using it here to make a Quadrilateral Cowboy map.


Edited by VelvetFistIronGlove, 23 November 2017 - 07:18 PM.


#2 greebo

greebo

    Heroic Coder

  • Root
  • 16010 posts

Posted 24 November 2017 - 03:21 AM

It seems DR is crashing when accessing the walker instance you're passing to traverse(). Turns out you'll need to explicitly init the super-class in your LightWalker constructor:

 

class LightWalker(dr.SceneNodeVisitor):
  def __init__(self, fix_on):
    super().__init__()
    self.fix_on = fix_on

 

This fixed it on my end.



#3 VelvetFistIronGlove

VelvetFistIronGlove

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 25 November 2017 - 06:02 AM

Thank you!

 

I really should've remembered to call super, but it's been a while since I worked with classes in Python. :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users