mirror of https://github.com/AxioDL/metaforce.git
Fixes for Blender 2.93
This commit is contained in:
parent
4028171fe7
commit
10fc1cb7ce
|
@ -461,7 +461,8 @@ 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"
|
||||
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"
|
||||
|
@ -470,18 +471,21 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
|
|||
"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"
|
||||
"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);
|
||||
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,7 +526,8 @@ 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"
|
||||
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"
|
||||
|
@ -532,10 +537,14 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
|
|||
"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"),
|
||||
"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],
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 3290b706fcf136c791526d6aa6099d8e6926a7be
|
||||
Subproject commit 6e896fa1d399927ba0558e6af3e084ea79ec6b88
|
|
@ -1 +1 @@
|
|||
Subproject commit 8877eab3933c7031e2b41f372b852618db219489
|
||||
Subproject commit 23a15834fa23226bd26a17f5142b00678617fec4
|
|
@ -1 +1 @@
|
|||
Subproject commit 3eccde013d11409383e5608f938a94f279204f96
|
||||
Subproject commit a525f607752b87d719c142ef88589e1e5bbfa9b5
|
|
@ -1 +1 @@
|
|||
Subproject commit bb9b4c83af12647df1db7978347bd297dda3277b
|
||||
Subproject commit f3630be9dee64378e7bcf20b4602b64bd8c810c0
|
|
@ -275,6 +275,11 @@ def recursive_cook(buffer, obj, version, path_hasher, parent_name):
|
|||
|
||||
def cook(writepipebuf, version, path_hasher):
|
||||
global hjustifications, vjustifications, model_draw_flags_e
|
||||
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'])
|
||||
|
@ -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')
|
||||
|
|
|
@ -249,10 +249,16 @@ def cook(writebuf, mesh_obj):
|
|||
if mesh_obj.type != 'MESH':
|
||||
raise RuntimeError("%s is not a mesh" % mesh_obj.name)
|
||||
|
||||
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
|
||||
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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue