diff --git a/DataSpec/DNAMP1/FRME.cpp b/DataSpec/DNAMP1/FRME.cpp index 9b2743947..0e9afe12d 100644 --- a/DataSpec/DNAMP1/FRME.cpp +++ b/DataSpec/DNAMP1/FRME.cpp @@ -461,27 +461,31 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: } zeus::simd_floats colorF(w.header.color.simd); - os.format(FMT_STRING("frme_obj = bpy.data.objects.new(name='{}', object_data=binding)\n" - "frme_obj.pass_index = {}\n" - "parentName = '{}'\n" - "frme_obj.retro_widget_type = 'RETRO_{}'\n" - "frme_obj.retro_widget_use_anim_controller = {}\n" - "frme_obj.retro_widget_default_visible = {}\n" - "frme_obj.retro_widget_default_active = {}\n" - "frme_obj.retro_widget_cull_faces = {}\n" - "frme_obj.retro_widget_color = ({},{},{},{})\n" - "frme_obj.retro_widget_model_draw_flags = " - "bpy.types.Object.retro_widget_model_draw_flags[1]['items'][{}][0]\n" - "frme_obj.retro_widget_is_worker = {}\n" - "frme_obj.retro_widget_worker_id = {}\n" - "if parentName not in bpy.data.objects:\n" - " frme_obj.retro_widget_parent = parentName\n" - "else:\n" - " frme_obj.parent = bpy.data.objects[parentName]\n"), - w.header.name, pIdx++, w.header.parent, w.type, w.header.useAnimController ? "True" : "False", - w.header.defaultVisible ? "True" : "False", w.header.defaultActive ? "True" : "False", - w.header.cullFaces ? "True" : "False", colorF[0], colorF[1], colorF[2], colorF[3], - w.header.modelDrawFlags, w.isWorker ? "True" : "False", w.workerId); + os.format(FMT_STRING( + "frme_obj = bpy.data.objects.new(name='{}', object_data=binding)\n" + "frme_obj.pass_index = {}\n" + "parentName = '{}'\n" + "frme_obj.retro_widget_type = 'RETRO_{}'\n" + "frme_obj.retro_widget_use_anim_controller = {}\n" + "frme_obj.retro_widget_default_visible = {}\n" + "frme_obj.retro_widget_default_active = {}\n" + "frme_obj.retro_widget_cull_faces = {}\n" + "frme_obj.retro_widget_color = ({},{},{},{})\n" + "widget_model_draw_flags = {}\n" + "if bpy.app.version >= (2, 93, 0):\n" + " frme_obj.retro_widget_model_draw_flags = bpy.types.Object.retro_widget_model_draw_flags.keywords['items'][widget_model_draw_flags][0]\n" + "else:\n" + " frme_obj.retro_widget_model_draw_flags = bpy.types.Object.retro_widget_model_draw_flags[1]['items'][widget_model_draw_flags][0]\n" + "frme_obj.retro_widget_is_worker = {}\n" + "frme_obj.retro_widget_worker_id = {}\n" + "if parentName not in bpy.data.objects:\n" + " frme_obj.retro_widget_parent = parentName\n" + "else:\n" + " frme_obj.parent = bpy.data.objects[parentName]\n"), + w.header.name, pIdx++, w.header.parent, w.type, + w.header.useAnimController ? "True" : "False", w.header.defaultVisible ? "True" : "False", + w.header.defaultActive ? "True" : "False", w.header.cullFaces ? "True" : "False", colorF[0], colorF[1], + colorF[2], colorF[3], w.header.modelDrawFlags, w.isWorker ? "True" : "False", w.workerId); if (w.type == SBIG('MODL')) { using MODLInfo = FRME::Widget::MODLInfo; @@ -522,25 +526,30 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl: zeus::simd_floats fillF(info->fillColor.simd); zeus::simd_floats outlineF(info->outlineColor.simd); zeus::simd_floats extentF(info->blockExtent.simd); - os.format(FMT_STRING("frme_obj.retro_pane_dimensions = ({},{})\n" - "frme_obj.retro_pane_scale_center = ({},{},{})\n" - "frme_obj.retro_textpane_font_path = '{}'\n" - "frme_obj.retro_textpane_word_wrap = {}\n" - "frme_obj.retro_textpane_horizontal = {}\n" - "frme_obj.retro_textpane_fill_color = ({},{},{},{})\n" - "frme_obj.retro_textpane_outline_color = ({},{},{},{})\n" - "frme_obj.retro_textpane_block_extent = ({},{})\n" - "frme_obj.retro_textpane_jp_font_path = '{}'\n" - "frme_obj.retro_textpane_jp_font_scale = ({},{})\n" - "frme_obj.retro_textpane_hjustification = " - "bpy.types.Object.retro_textpane_hjustification[1]['items'][{}][0]\n" - "frme_obj.retro_textpane_vjustification = " - "bpy.types.Object.retro_textpane_vjustification[1]['items'][{}][0]\n"), - info->xDim, info->zDim, scaleF[0], scaleF[1], scaleF[2], fontPath.getRelativePathUTF8(), - info->wordWrap ? "True" : "False", info->horizontal ? "True" : "False", fillF[0], fillF[1], fillF[2], - fillF[3], outlineF[0], outlineF[1], outlineF[2], outlineF[3], extentF[0], extentF[1], - jpFontPath.getRelativePathUTF8(), info->jpnPointScale[0], info->jpnPointScale[1], - int(info->justification), int(info->verticalJustification)); + os.format(FMT_STRING( + "frme_obj.retro_pane_dimensions = ({},{})\n" + "frme_obj.retro_pane_scale_center = ({},{},{})\n" + "frme_obj.retro_textpane_font_path = '{}'\n" + "frme_obj.retro_textpane_word_wrap = {}\n" + "frme_obj.retro_textpane_horizontal = {}\n" + "frme_obj.retro_textpane_fill_color = ({},{},{},{})\n" + "frme_obj.retro_textpane_outline_color = ({},{},{},{})\n" + "frme_obj.retro_textpane_block_extent = ({},{})\n" + "frme_obj.retro_textpane_jp_font_path = '{}'\n" + "frme_obj.retro_textpane_jp_font_scale = ({},{})\n" + "textpane_hjustification = {}\n" + "textpane_vjustification = {}\n" + "if bpy.app.version >= (2, 93, 0):\n" + " frme_obj.retro_textpane_hjustification = bpy.types.Object.retro_textpane_hjustification.keywords['items'][textpane_hjustification][0]\n" + " frme_obj.retro_textpane_vjustification = bpy.types.Object.retro_textpane_vjustification.keywords['items'][textpane_vjustification][0]\n" + "else:\n" + " frme_obj.retro_textpane_hjustification = bpy.types.Object.retro_textpane_hjustification[1]['items'][textpane_hjustification][0]\n" + " frme_obj.retro_textpane_vjustification = bpy.types.Object.retro_textpane_vjustification[1]['items'][textpane_vjustification][0]\n"), + info->xDim, info->zDim, scaleF[0], scaleF[1], scaleF[2], fontPath.getRelativePathUTF8(), + info->wordWrap ? "True" : "False", info->horizontal ? "True" : "False", fillF[0], fillF[1], fillF[2], + fillF[3], outlineF[0], outlineF[1], outlineF[2], outlineF[3], extentF[0], extentF[1], + jpFontPath.getRelativePathUTF8(), info->jpnPointScale[0], info->jpnPointScale[1], + int(info->justification), int(info->verticalJustification)); } } else if (w.type == SBIG('TBGP')) { using TBGPInfo = Widget::TBGPInfo; diff --git a/DataSpec/DNAMP1/MLVL.cpp b/DataSpec/DNAMP1/MLVL.cpp index b0b88e319..e32cf364e 100644 --- a/DataSpec/DNAMP1/MLVL.cpp +++ b/DataSpec/DNAMP1/MLVL.cpp @@ -157,8 +157,8 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat bool areaInit = false; size_t layerIdx = 0; LayerResources layerResources; - for (const hecl::DirectoryEnumerator::Entry& e : - hecl::DirectoryEnumerator(area.path.getAbsolutePath(), hecl::DirectoryEnumerator::Mode::DirsSorted)) { + const hecl::DirectoryEnumerator enumerator(area.path.getAbsolutePath(), hecl::DirectoryEnumerator::Mode::DirsSorted); + for (const hecl::DirectoryEnumerator::Entry& e : enumerator) { hecl::SystemString layerName; hecl::SystemChar* endCh = nullptr; hecl::StrToUl(e.m_name.c_str(), &endCh, 10); diff --git a/hecl/blender/hecl/frme.py b/hecl/blender/hecl/frme.py index 76c25ba5d..f762959d8 100644 --- a/hecl/blender/hecl/frme.py +++ b/hecl/blender/hecl/frme.py @@ -275,9 +275,14 @@ def recursive_cook(buffer, obj, version, path_hasher, parent_name): def cook(writepipebuf, version, path_hasher): global hjustifications, vjustifications, model_draw_flags_e - hjustifications = dict((i[0], i[3]) for i in bpy.types.Object.retro_textpane_hjustification[1]['items']) - vjustifications = dict((i[0], i[3]) for i in bpy.types.Object.retro_textpane_vjustification[1]['items']) - model_draw_flags_e = dict((i[0], i[3]) for i in bpy.types.Object.retro_widget_model_draw_flags[1]['items']) + if bpy.app.version >= (2, 93, 0): + hjustifications = dict((i[0], i[3]) for i in bpy.types.Object.retro_textpane_hjustification.keywords['items']) + vjustifications = dict((i[0], i[3]) for i in bpy.types.Object.retro_textpane_vjustification.keywords['items']) + model_draw_flags_e = dict((i[0], i[3]) for i in bpy.types.Object.retro_widget_model_draw_flags.keywords['items']) + else: + hjustifications = dict((i[0], i[3]) for i in bpy.types.Object.retro_textpane_hjustification[1]['items']) + vjustifications = dict((i[0], i[3]) for i in bpy.types.Object.retro_textpane_vjustification[1]['items']) + model_draw_flags_e = dict((i[0], i[3]) for i in bpy.types.Object.retro_widget_model_draw_flags[1]['items']) buffer = bytearray() buffer += struct.pack('>IIII', 0, 0, 0, 0) @@ -320,7 +325,7 @@ def register(): ('RETRO_ADDITIVE', 'Additive', '', 3), ('RETRO_ALPHA_ADDITIVE_OVERDRAW', 'Alpha Additive Overdraw', '', 4)] bpy.types.Object.retro_widget_parent = bpy.props.StringProperty(name='Retro: FRME Widget Parent', description='Refers to internal frame widgets') - bpy.types.Object.retro_widget_use_anim_controller = bpy.props.BoolProperty(name='Retro: Use Animiation Conroller') + bpy.types.Object.retro_widget_use_anim_controller = bpy.props.BoolProperty(name='Retro: Use Animation Controller') bpy.types.Object.retro_widget_default_visible = bpy.props.BoolProperty(name='Retro: Default Visible', description='Sets widget is visible by default') bpy.types.Object.retro_widget_default_active = bpy.props.BoolProperty(name='Retro: Default Active', description='Sets widget is cases by default') bpy.types.Object.retro_widget_cull_faces = bpy.props.BoolProperty(name='Retro: Cull Faces', description='Enables face culling') diff --git a/hecl/blender/hecl/mapa.py b/hecl/blender/hecl/mapa.py index 1817b5042..3a83dfa00 100644 --- a/hecl/blender/hecl/mapa.py +++ b/hecl/blender/hecl/mapa.py @@ -249,10 +249,16 @@ def cook(writebuf, mesh_obj): if mesh_obj.type != 'MESH': raise RuntimeError("%s is not a mesh" % mesh_obj.name) - obj_vismodes = dict((i[0], i[3]) for i in bpy.types.Object.retro_mapobj_vis_mode[1]['items']) + if bpy.app.version >= (2, 93, 0): + obj_vismodes = dict((i[0], i[3]) for i in bpy.types.Object.retro_mapobj_vis_mode.keywords['items']) + else: + obj_vismodes = dict((i[0], i[3]) for i in bpy.types.Object.retro_mapobj_vis_mode[1]['items']) # Write out visibility type - vis_types = dict((i[0], i[3]) for i in bpy.types.Scene.retro_map_vis_mode[1]['items']) + if hasattr(bpy.types.Scene.retro_map_vis_mode, '__getitem__'): + vis_types = dict((i[0], i[3]) for i in bpy.types.Scene.retro_map_vis_mode[1]['items']) + else: + vis_types = dict((i[0], i[3]) for i in bpy.types.Scene.retro_map_vis_mode.keywords['items']) writebuf(struct.pack('I', vis_types[bpy.context.scene.retro_map_vis_mode])) # Copy mesh (and apply mesh modifiers with triangulation) diff --git a/hecl/lib/Blender/Connection.cpp b/hecl/lib/Blender/Connection.cpp index 109d1eaaf..97fead242 100644 --- a/hecl/lib/Blender/Connection.cpp +++ b/hecl/lib/Blender/Connection.cpp @@ -51,7 +51,7 @@ namespace hecl::blender { static const uint32_t MinBlenderMajorSearch = 2; static const uint32_t MaxBlenderMajorSearch = 2; static const uint32_t MinBlenderMinorSearch = 83; -static const uint32_t MaxBlenderMinorSearch = 92; +static const uint32_t MaxBlenderMinorSearch = 93; logvisor::Module BlenderLog("hecl::blender::Connection"); Token SharedBlenderToken; diff --git a/metaforce-gui/FindBlender.hpp b/metaforce-gui/FindBlender.hpp index 7a09faeee..cabb872c5 100644 --- a/metaforce-gui/FindBlender.hpp +++ b/metaforce-gui/FindBlender.hpp @@ -6,7 +6,7 @@ namespace hecl::blender { constexpr uint32_t MinBlenderMajorSearch = 2; constexpr uint32_t MaxBlenderMajorSearch = 2; constexpr uint32_t MinBlenderMinorSearch = 83; -constexpr uint32_t MaxBlenderMinorSearch = 92; +constexpr uint32_t MaxBlenderMinorSearch = 93; hecl::SystemString FindBlender(int& major, int& minor);