<commit_before>from ToontownGlobals import *
import DirectNotifyGlobal
import BasicEntities

class ModelEntity(BasicEntities.NodePathEntity):
    def __init__(self, level, entId):
        BasicEntities.NodePathEntity.__init__(self, level, entId)
        self.model = None
        self.loadModel()
        
    def destroy(self):
        if self.model:
            self.model.removeNode()
            del self.model
        BasicEntities.NodePathEntity.destroy(self)

    def loadModel(self):
        if self.model:
            self.model.removeNode()
            self.model = None
        if self.modelPath:
            self.model = loader.loadModel(self.modelPath)
            if self.model:
                self.model.reparentTo(self)

        # HACK SDN: special code for moving crate wall collisions down
        if self.modelPath == "phase_9/models/cogHQ/woodCrateB":
            cNode = self.find("**/wall")
            if not cNode.isEmpty():
                cNode.setZ(-.5)

    def setModelPath(self, path):
        self.modelPath = path
        self.loadModel()
    
<commit_msg>move collisions walks down on crateB model<commit_after>from ToontownGlobals import *
import DirectNotifyGlobal
import BasicEntities

class ModelEntity(BasicEntities.NodePathEntity):
    def __init__(self, level, entId):
        BasicEntities.NodePathEntity.__init__(self, level, entId)
        self.model = None
        self.loadModel()
        
    def destroy(self):
        if self.model:
            self.model.removeNode()
            del self.model
        BasicEntities.NodePathEntity.destroy(self)

    def loadModel(self):
        if self.model:
            self.model.removeNode()
            self.model = None
        if self.modelPath:
            self.model = loader.loadModel(self.modelPath)
            if self.model:
                self.model.reparentTo(self)

        # HACK SDN: special code for moving crate wall collisions down
        if self.modelPath == "phase_9/models/cogHQ/woodCrateB.bam":
            cNode = self.find("**/wall")
            if not cNode.isEmpty():
                cNode.setZ(-.5)

    def setModelPath(self, path):
        self.modelPath = path
        self.loadModel()
    

{'fraction_non_alphanumeric': 0.09181365897783808, 'fraction_numerical': 0.0018091361374943465, 'mean_word_length': 2.0552486187845305, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3843962', 'n_tokens_mistral': 632, 'n_tokens_neox': 626, 'n_words': 138}