Skip to content

Commit

Permalink
Update insert_instance.py
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed Jul 17, 2024
1 parent f87daa7 commit a25c8c3
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _update_model(self):
)
self.ui.previewRenderer.clearModel()
return
self._extracted_from_onResourceSelected_19(modelname)
self.setRendererModelName(modelname)

def _setupSignals(self):
self.ui.createResourceRadio.toggled.connect(self.onResourceRadioToggled)
Expand Down Expand Up @@ -272,10 +272,10 @@ def onResourceSelected(self):
mdx_data: bytes | None = None
if resource.restype() is ResourceType.UTD and self.globalSettings.showPreviewUTD:
modelname: str = door.get_model(read_utd(resource.data()), self._installation)
self._extracted_from_onResourceSelected_19(modelname)
self.setRendererModelName(modelname)
elif resource.restype() is ResourceType.UTP and self.globalSettings.showPreviewUTP:
modelname: str = placeable.get_model(read_utp(resource.data()), self._installation)
self._extracted_from_onResourceSelected_19(modelname)
self.setRendererModelName(modelname)
elif (
resource.restype() in (ResourceType.MDL, ResourceType.MDX)
and any((
Expand Down Expand Up @@ -315,8 +315,7 @@ def onResourceSelected(self):
else:
self.ui.previewRenderer.clearModel()

# TODO Rename this here and in `_update_model` and `onResourceSelected`
def _extracted_from_onResourceSelected_19(self, modelname):
def setRendererModelName(self, modelname):
mdl: ResourceResult | None = self._installation.resource(
modelname, ResourceType.MDL
)
Expand Down

0 comments on commit a25c8c3

Please sign in to comment.