mirror of https://github.com/AxioDL/metaforce.git
Merge branch 'blender2.93'
This commit is contained in:
commit
1ed0a64618
|
@ -461,27 +461,31 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::simd_floats colorF(w.header.color.simd);
|
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.pass_index = {}\n"
|
"frme_obj = bpy.data.objects.new(name='{}', object_data=binding)\n"
|
||||||
"parentName = '{}'\n"
|
"frme_obj.pass_index = {}\n"
|
||||||
"frme_obj.retro_widget_type = 'RETRO_{}'\n"
|
"parentName = '{}'\n"
|
||||||
"frme_obj.retro_widget_use_anim_controller = {}\n"
|
"frme_obj.retro_widget_type = 'RETRO_{}'\n"
|
||||||
"frme_obj.retro_widget_default_visible = {}\n"
|
"frme_obj.retro_widget_use_anim_controller = {}\n"
|
||||||
"frme_obj.retro_widget_default_active = {}\n"
|
"frme_obj.retro_widget_default_visible = {}\n"
|
||||||
"frme_obj.retro_widget_cull_faces = {}\n"
|
"frme_obj.retro_widget_default_active = {}\n"
|
||||||
"frme_obj.retro_widget_color = ({},{},{},{})\n"
|
"frme_obj.retro_widget_cull_faces = {}\n"
|
||||||
"frme_obj.retro_widget_model_draw_flags = "
|
"frme_obj.retro_widget_color = ({},{},{},{})\n"
|
||||||
"bpy.types.Object.retro_widget_model_draw_flags[1]['items'][{}][0]\n"
|
"widget_model_draw_flags = {}\n"
|
||||||
"frme_obj.retro_widget_is_worker = {}\n"
|
"if bpy.app.version >= (2, 93, 0):\n"
|
||||||
"frme_obj.retro_widget_worker_id = {}\n"
|
" frme_obj.retro_widget_model_draw_flags = bpy.types.Object.retro_widget_model_draw_flags.keywords['items'][widget_model_draw_flags][0]\n"
|
||||||
"if parentName not in bpy.data.objects:\n"
|
"else:\n"
|
||||||
" frme_obj.retro_widget_parent = parentName\n"
|
" frme_obj.retro_widget_model_draw_flags = bpy.types.Object.retro_widget_model_draw_flags[1]['items'][widget_model_draw_flags][0]\n"
|
||||||
"else:\n"
|
"frme_obj.retro_widget_is_worker = {}\n"
|
||||||
" frme_obj.parent = bpy.data.objects[parentName]\n"),
|
"frme_obj.retro_widget_worker_id = {}\n"
|
||||||
w.header.name, pIdx++, w.header.parent, w.type, w.header.useAnimController ? "True" : "False",
|
"if parentName not in bpy.data.objects:\n"
|
||||||
w.header.defaultVisible ? "True" : "False", w.header.defaultActive ? "True" : "False",
|
" frme_obj.retro_widget_parent = parentName\n"
|
||||||
w.header.cullFaces ? "True" : "False", colorF[0], colorF[1], colorF[2], colorF[3],
|
"else:\n"
|
||||||
w.header.modelDrawFlags, w.isWorker ? "True" : "False", w.workerId);
|
" 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')) {
|
if (w.type == SBIG('MODL')) {
|
||||||
using MODLInfo = FRME::Widget::MODLInfo;
|
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 fillF(info->fillColor.simd);
|
||||||
zeus::simd_floats outlineF(info->outlineColor.simd);
|
zeus::simd_floats outlineF(info->outlineColor.simd);
|
||||||
zeus::simd_floats extentF(info->blockExtent.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_scale_center = ({},{},{})\n"
|
"frme_obj.retro_pane_dimensions = ({},{})\n"
|
||||||
"frme_obj.retro_textpane_font_path = '{}'\n"
|
"frme_obj.retro_pane_scale_center = ({},{},{})\n"
|
||||||
"frme_obj.retro_textpane_word_wrap = {}\n"
|
"frme_obj.retro_textpane_font_path = '{}'\n"
|
||||||
"frme_obj.retro_textpane_horizontal = {}\n"
|
"frme_obj.retro_textpane_word_wrap = {}\n"
|
||||||
"frme_obj.retro_textpane_fill_color = ({},{},{},{})\n"
|
"frme_obj.retro_textpane_horizontal = {}\n"
|
||||||
"frme_obj.retro_textpane_outline_color = ({},{},{},{})\n"
|
"frme_obj.retro_textpane_fill_color = ({},{},{},{})\n"
|
||||||
"frme_obj.retro_textpane_block_extent = ({},{})\n"
|
"frme_obj.retro_textpane_outline_color = ({},{},{},{})\n"
|
||||||
"frme_obj.retro_textpane_jp_font_path = '{}'\n"
|
"frme_obj.retro_textpane_block_extent = ({},{})\n"
|
||||||
"frme_obj.retro_textpane_jp_font_scale = ({},{})\n"
|
"frme_obj.retro_textpane_jp_font_path = '{}'\n"
|
||||||
"frme_obj.retro_textpane_hjustification = "
|
"frme_obj.retro_textpane_jp_font_scale = ({},{})\n"
|
||||||
"bpy.types.Object.retro_textpane_hjustification[1]['items'][{}][0]\n"
|
"textpane_hjustification = {}\n"
|
||||||
"frme_obj.retro_textpane_vjustification = "
|
"textpane_vjustification = {}\n"
|
||||||
"bpy.types.Object.retro_textpane_vjustification[1]['items'][{}][0]\n"),
|
"if bpy.app.version >= (2, 93, 0):\n"
|
||||||
info->xDim, info->zDim, scaleF[0], scaleF[1], scaleF[2], fontPath.getRelativePathUTF8(),
|
" frme_obj.retro_textpane_hjustification = bpy.types.Object.retro_textpane_hjustification.keywords['items'][textpane_hjustification][0]\n"
|
||||||
info->wordWrap ? "True" : "False", info->horizontal ? "True" : "False", fillF[0], fillF[1], fillF[2],
|
" frme_obj.retro_textpane_vjustification = bpy.types.Object.retro_textpane_vjustification.keywords['items'][textpane_vjustification][0]\n"
|
||||||
fillF[3], outlineF[0], outlineF[1], outlineF[2], outlineF[3], extentF[0], extentF[1],
|
"else:\n"
|
||||||
jpFontPath.getRelativePathUTF8(), info->jpnPointScale[0], info->jpnPointScale[1],
|
" frme_obj.retro_textpane_hjustification = bpy.types.Object.retro_textpane_hjustification[1]['items'][textpane_hjustification][0]\n"
|
||||||
int(info->justification), int(info->verticalJustification));
|
" 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')) {
|
} else if (w.type == SBIG('TBGP')) {
|
||||||
using TBGPInfo = Widget::TBGPInfo;
|
using TBGPInfo = Widget::TBGPInfo;
|
||||||
|
|
|
@ -157,8 +157,8 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
|
||||||
bool areaInit = false;
|
bool areaInit = false;
|
||||||
size_t layerIdx = 0;
|
size_t layerIdx = 0;
|
||||||
LayerResources layerResources;
|
LayerResources layerResources;
|
||||||
for (const hecl::DirectoryEnumerator::Entry& e :
|
const hecl::DirectoryEnumerator enumerator(area.path.getAbsolutePath(), hecl::DirectoryEnumerator::Mode::DirsSorted);
|
||||||
hecl::DirectoryEnumerator(area.path.getAbsolutePath(), hecl::DirectoryEnumerator::Mode::DirsSorted)) {
|
for (const hecl::DirectoryEnumerator::Entry& e : enumerator) {
|
||||||
hecl::SystemString layerName;
|
hecl::SystemString layerName;
|
||||||
hecl::SystemChar* endCh = nullptr;
|
hecl::SystemChar* endCh = nullptr;
|
||||||
hecl::StrToUl(e.m_name.c_str(), &endCh, 10);
|
hecl::StrToUl(e.m_name.c_str(), &endCh, 10);
|
||||||
|
|
|
@ -275,9 +275,14 @@ def recursive_cook(buffer, obj, version, path_hasher, parent_name):
|
||||||
|
|
||||||
def cook(writepipebuf, version, path_hasher):
|
def cook(writepipebuf, version, path_hasher):
|
||||||
global hjustifications, vjustifications, model_draw_flags_e
|
global hjustifications, vjustifications, model_draw_flags_e
|
||||||
hjustifications = dict((i[0], i[3]) for i in bpy.types.Object.retro_textpane_hjustification[1]['items'])
|
if bpy.app.version >= (2, 93, 0):
|
||||||
vjustifications = dict((i[0], i[3]) for i in bpy.types.Object.retro_textpane_vjustification[1]['items'])
|
hjustifications = dict((i[0], i[3]) for i in bpy.types.Object.retro_textpane_hjustification.keywords['items'])
|
||||||
model_draw_flags_e = dict((i[0], i[3]) for i in bpy.types.Object.retro_widget_model_draw_flags[1]['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 = bytearray()
|
||||||
buffer += struct.pack('>IIII', 0, 0, 0, 0)
|
buffer += struct.pack('>IIII', 0, 0, 0, 0)
|
||||||
|
@ -320,7 +325,7 @@ def register():
|
||||||
('RETRO_ADDITIVE', 'Additive', '', 3),
|
('RETRO_ADDITIVE', 'Additive', '', 3),
|
||||||
('RETRO_ALPHA_ADDITIVE_OVERDRAW', 'Alpha Additive Overdraw', '', 4)]
|
('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_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_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_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')
|
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':
|
if mesh_obj.type != 'MESH':
|
||||||
raise RuntimeError("%s is not a mesh" % mesh_obj.name)
|
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
|
# 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]))
|
writebuf(struct.pack('I', vis_types[bpy.context.scene.retro_map_vis_mode]))
|
||||||
|
|
||||||
# Copy mesh (and apply mesh modifiers with triangulation)
|
# 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 MinBlenderMajorSearch = 2;
|
||||||
static const uint32_t MaxBlenderMajorSearch = 2;
|
static const uint32_t MaxBlenderMajorSearch = 2;
|
||||||
static const uint32_t MinBlenderMinorSearch = 83;
|
static const uint32_t MinBlenderMinorSearch = 83;
|
||||||
static const uint32_t MaxBlenderMinorSearch = 92;
|
static const uint32_t MaxBlenderMinorSearch = 93;
|
||||||
|
|
||||||
logvisor::Module BlenderLog("hecl::blender::Connection");
|
logvisor::Module BlenderLog("hecl::blender::Connection");
|
||||||
Token SharedBlenderToken;
|
Token SharedBlenderToken;
|
||||||
|
|
|
@ -6,7 +6,7 @@ namespace hecl::blender {
|
||||||
constexpr uint32_t MinBlenderMajorSearch = 2;
|
constexpr uint32_t MinBlenderMajorSearch = 2;
|
||||||
constexpr uint32_t MaxBlenderMajorSearch = 2;
|
constexpr uint32_t MaxBlenderMajorSearch = 2;
|
||||||
constexpr uint32_t MinBlenderMinorSearch = 83;
|
constexpr uint32_t MinBlenderMinorSearch = 83;
|
||||||
constexpr uint32_t MaxBlenderMinorSearch = 92;
|
constexpr uint32_t MaxBlenderMinorSearch = 93;
|
||||||
|
|
||||||
hecl::SystemString FindBlender(int& major, int& minor);
|
hecl::SystemString FindBlender(int& major, int& minor);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue