Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions fast64_internal/f3d/f3d_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,11 +768,11 @@ def tmemUsageUI(layout, textureProp):
# cycle type = 1 cycle
class F3DPanel(Panel):
bl_label = "F3D Material"
bl_parent_id = "EEVEE_MATERIAL_PT_context_material"
bl_idname = "MATERIAL_PT_F3D_Inspector"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"
bl_options = {"HIDE_HEADER"}

def ui_prop(self, material, layout, name, setName, setProp, showCheckBox):
nodes = material.node_tree.nodes
Expand Down Expand Up @@ -1418,9 +1418,6 @@ def draw(self, context):
f3dMat = material.f3d_mat
settings = f3dMat.rdp_settings
layout.prop(context.scene, "f3d_simple", text="Show Simplified UI")
layout = layout.box()
titleCol = layout.column()
titleCol.box().label(text="F3D Material Inspector")

if material.mat_ver < 5:
box = layout.box().column()
Expand Down Expand Up @@ -1465,20 +1462,19 @@ def draw(self, context):

class F3DMeshPanel(Panel):
bl_label = "F3D Mesh Inspector"
bl_parent_id = "OBJECT_PT_context_object"
bl_idname = "F3D_PT_Mesh_Inspector"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
bl_options = {"HIDE_HEADER"}

@classmethod
def poll(cls, context):
return context.object.type == "MESH"

def draw(self, context):
new_gbi = not get_F3D_GBI().F3D_OLD_GBI
col = self.layout.box().column()
col.box().label(text=self.bl_label, icon="MESH_DATA")
col = self.layout.column()
row = col.row()
row.enabled = new_gbi
row.prop(context.object, "use_f3d_culling")
Expand All @@ -1494,14 +1490,7 @@ def ui_tileScroll(tex, name, layout):
row.prop(tex.tile_scroll, "interval", text="Interval:")


def ui_procAnimVecEnum(material, procAnimVec, layout, name, vecType, useDropdown, useTex0, useTex1):
layout = layout.box()
box = layout.column()
if useDropdown:
layout.prop(procAnimVec, "menu", text=name, icon="TRIA_DOWN" if procAnimVec.menu else "TRIA_RIGHT")
else:
layout.box().label(text=name)

def ui_procAnimVecEnum(material, procAnimVec, layout, vecType, useDropdown, useTex0, useTex1):
if not useDropdown or procAnimVec.menu:
box = layout.column()
combinedOption = None
Expand All @@ -1524,8 +1513,6 @@ def ui_procAnimVecEnum(material, procAnimVec, layout, name, vecType, useDropdown
pass

if useTex0 or useTex1:
layout.box().label(text="SM64 SetTileSize Texture Scroll")

if useTex0:
ui_tileScroll(material.tex0, "Texture 0 Speed", layout)

Expand Down Expand Up @@ -1565,8 +1552,8 @@ def ui_procAnimField(procAnimField, layout, name):
split2.prop(procAnimField, "noiseAmplitude")


def ui_procAnim(material, layout, useTex0, useTex1, title, useDropdown):
ui_procAnimVecEnum(material.f3d_mat, material.f3d_mat.UVanim0, layout, title, "UV", useDropdown, useTex0, useTex1)
def ui_procAnim(material, layout, useTex0, useTex1, useDropdown):
ui_procAnimVecEnum(material.f3d_mat, material.f3d_mat.UVanim0, layout, "UV", useDropdown, useTex0, useTex1)


def update_node_values(self, context, update_preset):
Expand Down Expand Up @@ -3891,10 +3878,10 @@ def draw_rdp_world_defaults(layout: UILayout, scene: Scene):
class DefaultRDPSettingsPanel(Panel):
bl_label = "RDP Default Settings"
bl_idname = "WORLD_PT_RDP_Default_Inspector"
bl_parent_id = "WORLD_PT_context_world"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "world"
bl_options = {"HIDE_HEADER"}

def draw(self, context):
draw_rdp_world_defaults(self.layout, context.scene)
Expand Down Expand Up @@ -4991,7 +4978,6 @@ def mat_register():
World.menu_upper = bpy.props.BoolProperty()
World.menu_lower = bpy.props.BoolProperty()
World.menu_other = bpy.props.BoolProperty()
World.menu_layers = bpy.props.BoolProperty()

Material.is_f3d = bpy.props.BoolProperty()
Material.mat_ver = bpy.props.IntProperty(default=1)
Expand Down
7 changes: 3 additions & 4 deletions fast64_internal/f3d/flipbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ def drawFlipbookGroupProperty(
checkFlipbookReference: Callable[[str], bool],
drawFlipbookRequirementMessage: Callable[[bpy.types.UILayout], None],
):
layout.box().column().label(text="Flipbook Properties")
if drawFlipbookRequirementMessage is not None:
drawFlipbookRequirementMessage(layout)
for i in range(2):
Expand Down Expand Up @@ -275,12 +274,12 @@ def flipbookAnimHandler(dummy):


class Flipbook_MaterialPanel(bpy.types.Panel):
bl_label = "Flipbook Material"
bl_label = "Flipbook Properties"
bl_idname = "MATERIAL_PT_Flipbook_Material_Inspector"
bl_parent_id = "MATERIAL_PT_OOT_Material_Inspector"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"
bl_options = {"HIDE_HEADER"}

@classmethod
def poll(cls, context):
Expand All @@ -298,7 +297,7 @@ def draw(self, context):
checkFlipbookReference = None
drawFlipbookRequirementMessage = None

drawFlipbookGroupProperty(col.box().column(), mat, checkFlipbookReference, drawFlipbookRequirementMessage)
drawFlipbookGroupProperty(col, mat, checkFlipbookReference, drawFlipbookRequirementMessage)


def setTexNodeImage(material: bpy.types.Material, texIndex: int, flipbookIndex: int):
Expand Down
26 changes: 26 additions & 0 deletions fast64_internal/sm64/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from bpy.utils import register_class, unregister_class
from bpy.types import Panel

from .settings import (
settings_props_register,
settings_props_unregister,
Expand Down Expand Up @@ -91,7 +94,28 @@
)


class SM64_MaterialPanel(Panel):
bl_label = "SM64 Material"
bl_idname = "MATERIAL_PT_SM64_Material_Inspector"
bl_parent_id = "EEVEE_MATERIAL_PT_context_material"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"

@classmethod
def poll(cls, context):
return context.material is not None and context.material.is_f3d and context.scene.gameEditorMode == "SM64"

def draw(self, context):
pass


panels = (SM64_MaterialPanel,)


def sm64_panel_register():
for cls in panels:
register_class(cls)
settings_panels_register()
tools_panels_register()
sm64_col_panel_register()
Expand All @@ -107,6 +131,8 @@ def sm64_panel_register():


def sm64_panel_unregister():
for cls in panels:
unregister_class(cls)
settings_panels_unregister()
tools_panels_unregister()
sm64_col_panel_unregister()
Expand Down
4 changes: 2 additions & 2 deletions fast64_internal/sm64/sm64_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@


class CameraSettingsPanel(bpy.types.Panel):
bl_label = "Camera Settings"
bl_label = "SM64 Camera Settings"
bl_idname = "Camera_Inspector"
bl_parent_id = "DATA_PT_context_camera"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "data"
bl_options = {"HIDE_HEADER"}

@classmethod
def poll(cls, context):
Expand Down
26 changes: 11 additions & 15 deletions fast64_internal/sm64/sm64_collision.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,12 @@ def to_binary(self):


class SM64CollisionPanel(bpy.types.Panel):
bl_label = "Collision Inspector"
bl_label = "Collision"
bl_idname = "MATERIAL_PT_SM64_Collision_Inspector"
bl_parent_id = "MATERIAL_PT_SM64_Material_Inspector"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"
bl_options = {"HIDE_HEADER"}

@classmethod
def poll(cls, context):
return context.scene.gameEditorMode == "SM64" and context.material is not None

def paramInfo(self, layout):
box = layout.box()
Expand All @@ -210,32 +206,32 @@ def paramInfo(self, layout):
box.label(text="Second byte is a rotation value.")

def draw(self, context):
box = self.layout.box()
col = self.layout.column()
# box.label(text = 'Collision Inspector')
material = context.material
if not material.collision_all_options:
prop_split(box, material, "collision_type_simple", "SM64 Collision Type")
prop_split(col, material, "collision_type_simple", "SM64 Collision Type")
if material.collision_type_simple == "Custom":
prop_split(box, material, "collision_custom", "Collision Value")
prop_split(col, material, "collision_custom", "Collision Value")
# if material.collision_type_simple in specialSurfaces:
# prop_split(box, material, 'collision_param', 'Parameter')
# self.paramInfo(box)
else:
prop_split(box, material, "collision_type", "SM64 Collision Type All")
prop_split(col, material, "collision_type", "SM64 Collision Type All")
if material.collision_type == "Custom":
prop_split(box, material, "collision_custom", "Collision Value")
prop_split(col, material, "collision_custom", "Collision Value")
# if material.collision_type in specialSurfaces:
# prop_split(box, material, 'collision_param', 'Parameter')
# self.paramInfo(box)

split = box.split(factor=0.5)
split = col.split(factor=0.5)
split.label(text="")
split.prop(material, "collision_all_options")

box.prop(material, "use_collision_param")
col.prop(material, "use_collision_param")
if material.use_collision_param:
prop_split(box, material, "collision_param", "Parameter")
self.paramInfo(box)
prop_split(col, material, "collision_param", "Parameter")
self.paramInfo(col)

# infoBox = box.box()
# infoBox.label(text = \
Expand Down
31 changes: 13 additions & 18 deletions fast64_internal/sm64/sm64_f3d_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,10 +857,10 @@ def draw(self, context):
class SM64_DrawLayersPanel(bpy.types.Panel):
bl_label = "SM64 Draw Layers"
bl_idname = "WORLD_PT_SM64_Draw_Layers_Panel"
bl_parent_id = "WORLD_PT_context_world"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "world"
bl_options = {"HIDE_HEADER"}

@classmethod
def poll(cls, context):
Expand All @@ -881,38 +881,33 @@ def draw(self, context):


def drawLayerUI(layout, drawLayer, world):
box = layout.box()
box.label(text="Layer " + str(drawLayer))
row = box.row()
layout.label(text="Layer " + str(drawLayer))
row = layout.row()
row.prop(world, "draw_layer_" + str(drawLayer) + "_cycle_1", text="")
row.prop(world, "draw_layer_" + str(drawLayer) + "_cycle_2", text="")


class SM64_MaterialPanel(bpy.types.Panel):
bl_label = "SM64 Material"
bl_idname = "MATERIAL_PT_SM64_Material_Inspector"
class SM64_ScrollPanel(bpy.types.Panel):
bl_label = "Scrolling"
bl_idname = "MATERIAL_PT_SM64_Scroll"
bl_parent_id = "MATERIAL_PT_SM64_Material_Inspector"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"
bl_options = {"HIDE_HEADER"}

@classmethod
def poll(cls, context):
return context.material is not None and context.material.is_f3d and context.scene.gameEditorMode == "SM64"
use_dict = all_combiner_uses(context.material.f3d_mat)
return use_dict["Texture 0"] or use_dict["Texture 1"]

def draw(self, context):
layout = self.layout
col = self.layout.column()
material = context.material
col = layout.column()

if material.mat_ver > 3:
f3dMat = material.f3d_mat
else:
f3dMat = material
f3dMat = material.f3d_mat
useDict = all_combiner_uses(f3dMat)

if useDict["Texture"]:
ui_procAnim(material, col, useDict["Texture 0"], useDict["Texture 1"], "SM64 UV Texture Scroll", False)
ui_procAnim(material, col, useDict["Texture 0"], useDict["Texture 1"], False)


sm64_dl_writer_classes = (
Expand All @@ -922,7 +917,7 @@ def draw(self, context):
)

sm64_dl_writer_panel_classes = (
SM64_MaterialPanel,
SM64_ScrollPanel,
SM64_DrawLayersPanel,
SM64_ExportDLPanel,
ExportTexRectDrawPanel,
Expand Down
21 changes: 9 additions & 12 deletions fast64_internal/sm64/sm64_geolayout_bone.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@

def drawGeoInfo(panel: Panel, bone: Bone):
bone_props: "SM64_BoneProperties" = bone.fast64.sm64
panel.layout.box().label(text="Geolayout Inspector")
if bone is None:
panel.layout.label(text="Edit geolayout properties in Pose mode.")
return
Expand Down Expand Up @@ -168,12 +167,12 @@ def drawGeoInfo(panel: Panel, bone: Bone):


class GeolayoutBonePanel(Panel):
bl_label = "Geolayout Inspector"
bl_label = "SM64 Bone Inspector"
bl_idname = "BONE_PT_SM64_Geolayout_Inspector"
bl_parent_id = "BONE_PT_context_bone"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "bone"
bl_options = {"HIDE_HEADER"}

@classmethod
def poll(cls, context):
Expand All @@ -184,12 +183,12 @@ def draw(self, context):


class GeolayoutArmaturePanel(Panel):
bl_label = "Geolayout Armature Inspector"
bl_label = "SM64 Armature Inspector"
bl_idname = "OBJECT_PT_SM64_Armature_Geolayout_Inspector"
bl_parent_id = "OBJECT_PT_context_object"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
bl_options = {"HIDE_HEADER"}

@classmethod
def poll(cls, context):
Expand All @@ -201,8 +200,7 @@ def poll(cls, context):

def draw(self, context):
obj = context.object
col = self.layout.column().box()
col.box().label(text="Armature Geolayout Inspector")
col = self.layout.column()

col.prop(obj, "use_render_area")
if obj.use_render_area:
Expand All @@ -218,12 +216,12 @@ def drawLayerWarningBox(layout, prop, data):


class GeolayoutObjectPanel(Panel):
bl_label = "Object Geolayout Inspector"
bl_idname = "OBJECT_PT_SM64_Object_Geolayout_Inspector"
bl_label = "SM64 Geolayout"
bl_idname = "OBJECT_PT_SM64_Geolayout"
bl_parent_id = "OBJECT_PT_context_object"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
bl_options = {"HIDE_HEADER"}

@classmethod
def poll(cls, context):
Expand All @@ -235,8 +233,7 @@ def poll(cls, context):

def draw(self, context):
obj = context.object
col = self.layout.column().box()
col.box().label(text="Object Geolayout Inspector")
col = self.layout.column()

prop_split(col, obj, "geo_cmd_static", "Geolayout Command")
drawLayerWarningBox(col, obj, "draw_layer_static")
Expand Down
Loading