mirror of
https://github.com/ApfelTeeSaft/lightspeed64.git
synced 2026-08-26 19:33:24 +00:00
[OoT] Update actor scale's default value (#508)
* make actor scale default to 10 * add a print for clarity * Show actor scale outside custom and check custom in skeletons Not an oot expert but this seems like a very obvious issue with this. --------- Co-authored-by: Lila <[email protected]>
This commit is contained in:
@@ -123,7 +123,7 @@ class OOT_ImportDL(Operator):
|
||||
filedata = getImportData(paths)
|
||||
f3dContext = OOTF3DContext(get_F3D_GBI(), [name], basePath)
|
||||
|
||||
scale = getOOTScale(settings.actorScale)
|
||||
scale = None
|
||||
if not isCustomImport:
|
||||
filedata = ootGetIncludedAssetData(basePath, paths, filedata) + filedata
|
||||
|
||||
@@ -132,6 +132,9 @@ class OOT_ImportDL(Operator):
|
||||
if settings.autoDetectActorScale:
|
||||
scale = ootReadActorScale(basePath, overlayName, False)
|
||||
|
||||
if scale is None:
|
||||
scale = getOOTScale(settings.actorScale)
|
||||
|
||||
obj = importMeshC(
|
||||
filedata,
|
||||
name,
|
||||
|
||||
@@ -62,12 +62,13 @@ class OOTDLImportSettings(PropertyGroup):
|
||||
flipbookUses2DArray: BoolProperty(name="Has 2D Flipbook Array", default=False)
|
||||
flipbookArrayIndex2D: IntProperty(name="Index if 2D Array", default=0, min=0)
|
||||
autoDetectActorScale: BoolProperty(name="Auto Detect Actor Scale", default=True)
|
||||
actorScale: FloatProperty(name="Actor Scale", min=0, default=100)
|
||||
actorScale: FloatProperty(name="Actor Scale", min=0, default=10)
|
||||
|
||||
def draw_props(self, layout: UILayout):
|
||||
prop_split(layout, self, "name", "DL")
|
||||
if self.isCustom:
|
||||
prop_split(layout, self, "customPath", "File")
|
||||
prop_split(layout, self, "actorScale", "Actor Scale")
|
||||
else:
|
||||
prop_split(layout, self, "folder", "Object")
|
||||
prop_split(layout, self, "actorOverlayName", "Overlay (Optional)")
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import bpy, os, re
|
||||
import os
|
||||
import re
|
||||
import bpy
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from ..utility import CData, getGroupIndexFromname, readFile, writeFile
|
||||
from ..f3d.flipbook import flipbook_to_c, flipbook_2d_to_c, flipbook_data_to_c
|
||||
from ..f3d.f3d_material import createF3DMat, F3DMaterial_UpdateLock, update_preset_manual
|
||||
@@ -327,7 +332,7 @@ def writeTextureArraysExisting2D(data: str, flipbook: TextureFlipbook, flipbookA
|
||||
|
||||
|
||||
# Note this does not work well with actors containing multiple "parts". (z_en_honotrap)
|
||||
def ootReadActorScale(basePath: str, overlayName: str, isLink: bool) -> float:
|
||||
def ootReadActorScale(basePath: str, overlayName: str, isLink: bool) -> Optional[float]:
|
||||
if not isLink:
|
||||
actorData = ootGetActorData(basePath, overlayName)
|
||||
else:
|
||||
@@ -347,4 +352,5 @@ def ootReadActorScale(basePath: str, overlayName: str, isLink: bool) -> float:
|
||||
scale = scale[:-1]
|
||||
return getOOTScale(1 / float(scale))
|
||||
|
||||
return getOOTScale(100)
|
||||
print("WARNING: auto-detection failed, defaulting to this panel's actor scale property value")
|
||||
return None
|
||||
|
||||
@@ -280,9 +280,12 @@ def ootImportSkeletonC(basePath: str, importSettings: OOTSkeletonImportSettings)
|
||||
f3dContext = OOTF3DContext(get_F3D_GBI(), limbList, basePath)
|
||||
f3dContext.mat().draw_layer.oot = drawLayer
|
||||
|
||||
if overlayName is not None and importSettings.autoDetectActorScale:
|
||||
actorScale = None
|
||||
|
||||
if overlayName is not None and importSettings.autoDetectActorScale and not importSettings.isCustom:
|
||||
actorScale = ootReadActorScale(basePath, overlayName, isLink)
|
||||
else:
|
||||
|
||||
if actorScale is None:
|
||||
actorScale = getOOTScale(importSettings.actorScale)
|
||||
|
||||
# print(limbList)
|
||||
|
||||
@@ -122,7 +122,7 @@ class OOTSkeletonImportSettings(PropertyGroup):
|
||||
flipbookUses2DArray: BoolProperty(name="Has 2D Flipbook Array", default=False)
|
||||
flipbookArrayIndex2D: IntProperty(name="Index if 2D Array", default=0, min=0)
|
||||
autoDetectActorScale: BoolProperty(name="Auto Detect Actor Scale", default=True)
|
||||
actorScale: FloatProperty(name="Actor Scale", min=0, default=100)
|
||||
actorScale: FloatProperty(name="Actor Scale", min=0, default=10)
|
||||
|
||||
def draw_props(self, layout: UILayout):
|
||||
prop_split(layout, self, "drawLayer", "Import Draw Layer")
|
||||
@@ -132,6 +132,7 @@ class OOTSkeletonImportSettings(PropertyGroup):
|
||||
if self.isCustom:
|
||||
prop_split(layout, self, "name", "Skeleton")
|
||||
prop_split(layout, self, "customPath", "File")
|
||||
prop_split(layout, self, "actorScale", "Actor Scale")
|
||||
else:
|
||||
prop_split(layout, self, "mode", "Mode")
|
||||
if self.mode == "Generic":
|
||||
@@ -172,7 +173,7 @@ def skeleton_props_register():
|
||||
for cls in oot_skeleton_classes:
|
||||
register_class(cls)
|
||||
|
||||
Object.ootActorScale = FloatProperty(min=0, default=100)
|
||||
Object.ootActorScale = FloatProperty(min=0, default=10)
|
||||
Object.ootSkeleton = PointerProperty(type=OOTSkeletonProperty)
|
||||
Bone.ootBone = PointerProperty(type=OOTBoneProperty)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user