mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-04 19:15:52 +00:00
Various extract tweaks; ResourceLock integration
This commit is contained in:
parent
02a4d5501f
commit
42d39bf6b9
@ -420,7 +420,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void InitGeomBlenderContext(hecl::BlenderConnection::PyOutStream& os,
|
void InitGeomBlenderContext(hecl::BlenderConnection::PyOutStream& os,
|
||||||
const hecl::ProjectPath& masterShaderPath)
|
const hecl::ProjectPath& masterShaderPath,
|
||||||
|
bool solidShading)
|
||||||
{
|
{
|
||||||
os << "import math\n"
|
os << "import math\n"
|
||||||
"from mathutils import Vector\n"
|
"from mathutils import Vector\n"
|
||||||
@ -505,6 +506,14 @@ void InitGeomBlenderContext(hecl::BlenderConnection::PyOutStream& os,
|
|||||||
" return result\n"
|
" return result\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
|
if (solidShading)
|
||||||
|
{
|
||||||
|
os << "for ar in bpy.context.screen.areas:\n"
|
||||||
|
" for sp in ar.spaces:\n"
|
||||||
|
" if sp.type == 'VIEW_3D':\n"
|
||||||
|
" sp.viewport_shade = 'SOLID'\n";
|
||||||
|
}
|
||||||
|
|
||||||
/* Link master shader library */
|
/* Link master shader library */
|
||||||
os.format("# Master shader library\n"
|
os.format("# Master shader library\n"
|
||||||
"with bpy.data.libraries.load('%s', link=True, relative=True) as (data_from, data_to):\n"
|
"with bpy.data.libraries.load('%s', link=True, relative=True) as (data_from, data_to):\n"
|
||||||
@ -1102,7 +1111,7 @@ bool ReadCMDLToBlender(hecl::BlenderConnection& conn,
|
|||||||
"bpy.context.scene.name = '%s'\n"
|
"bpy.context.scene.name = '%s'\n"
|
||||||
"bpy.context.scene.hecl_mesh_obj = bpy.context.scene.name\n",
|
"bpy.context.scene.hecl_mesh_obj = bpy.context.scene.name\n",
|
||||||
pakRouter.getBestEntryName(entry).c_str());
|
pakRouter.getBestEntryName(entry).c_str());
|
||||||
InitGeomBlenderContext(os, dataspec.getMasterShaderPath());
|
InitGeomBlenderContext(os, dataspec.getMasterShaderPath(), false);
|
||||||
MaterialSet::RegisterMaterialProps(os);
|
MaterialSet::RegisterMaterialProps(os);
|
||||||
|
|
||||||
os << "# Materials\n"
|
os << "# Materials\n"
|
||||||
|
@ -131,7 +131,8 @@ void ReadMaterialSetToBlender_3(hecl::BlenderConnection::PyOutStream& os,
|
|||||||
unsigned setIdx);
|
unsigned setIdx);
|
||||||
|
|
||||||
void InitGeomBlenderContext(hecl::BlenderConnection::PyOutStream& os,
|
void InitGeomBlenderContext(hecl::BlenderConnection::PyOutStream& os,
|
||||||
const hecl::ProjectPath& masterShaderPath);
|
const hecl::ProjectPath& masterShaderPath,
|
||||||
|
bool solidShading);
|
||||||
void FinishBlenderMesh(hecl::BlenderConnection::PyOutStream& os,
|
void FinishBlenderMesh(hecl::BlenderConnection::PyOutStream& os,
|
||||||
unsigned matSetCount, int meshIdx);
|
unsigned matSetCount, int meshIdx);
|
||||||
|
|
||||||
|
@ -459,6 +459,11 @@ bool PAKRouter<BRIDGETYPE>::extractResources(const BRIDGETYPE& pakBridge, bool f
|
|||||||
|
|
||||||
const nod::Node* node = m_node.get();
|
const nod::Node* node = m_node.get();
|
||||||
|
|
||||||
|
hecl::ProjectPath working = getWorking(item, extractor);
|
||||||
|
hecl::ResourceLock resLk(working);
|
||||||
|
if (!resLk)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Extract first, so they start out invalid */
|
/* Extract first, so they start out invalid */
|
||||||
hecl::ProjectPath cooked = getCooked(item);
|
hecl::ProjectPath cooked = getCooked(item);
|
||||||
if (force || cooked.getPathType() == hecl::ProjectPath::Type::None)
|
if (force || cooked.getPathType() == hecl::ProjectPath::Type::None)
|
||||||
@ -469,7 +474,6 @@ bool PAKRouter<BRIDGETYPE>::extractResources(const BRIDGETYPE& pakBridge, bool f
|
|||||||
fclose(fout);
|
fclose(fout);
|
||||||
}
|
}
|
||||||
|
|
||||||
hecl::ProjectPath working = getWorking(item, extractor);
|
|
||||||
if (extractor.func_a) /* Doesn't need PAKRouter access */
|
if (extractor.func_a) /* Doesn't need PAKRouter access */
|
||||||
{
|
{
|
||||||
if (force || working.getPathType() == hecl::ProjectPath::Type::None)
|
if (force || working.getPathType() == hecl::ProjectPath::Type::None)
|
||||||
|
@ -93,7 +93,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
|
|||||||
"\n"
|
"\n"
|
||||||
"bpy.context.scene.name = '%s'\n",
|
"bpy.context.scene.name = '%s'\n",
|
||||||
pakRouter.getBestEntryName(entry).c_str());
|
pakRouter.getBestEntryName(entry).c_str());
|
||||||
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath());
|
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath(), true);
|
||||||
MaterialSet::RegisterMaterialProps(os);
|
MaterialSet::RegisterMaterialProps(os);
|
||||||
os << "# Clear Scene\n"
|
os << "# Clear Scene\n"
|
||||||
"for ob in bpy.data.objects:\n"
|
"for ob in bpy.data.objects:\n"
|
||||||
|
@ -223,7 +223,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
|
|||||||
"\n"
|
"\n"
|
||||||
"bpy.context.scene.name = '%s'\n",
|
"bpy.context.scene.name = '%s'\n",
|
||||||
pakRouter.getBestEntryName(entry).c_str());
|
pakRouter.getBestEntryName(entry).c_str());
|
||||||
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath());
|
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath(), true);
|
||||||
MaterialSet::RegisterMaterialProps(os);
|
MaterialSet::RegisterMaterialProps(os);
|
||||||
os << "# Clear Scene\n"
|
os << "# Clear Scene\n"
|
||||||
"for ob in bpy.data.objects:\n"
|
"for ob in bpy.data.objects:\n"
|
||||||
|
@ -122,7 +122,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
|
|||||||
"\n"
|
"\n"
|
||||||
"bpy.context.scene.name = '%s'\n",
|
"bpy.context.scene.name = '%s'\n",
|
||||||
pakRouter.getBestEntryName(entry).c_str());
|
pakRouter.getBestEntryName(entry).c_str());
|
||||||
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath());
|
DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath(), true);
|
||||||
MaterialSet::RegisterMaterialProps(os);
|
MaterialSet::RegisterMaterialProps(os);
|
||||||
os << "# Clear Scene\n"
|
os << "# Clear Scene\n"
|
||||||
"for ob in bpy.data.objects:\n"
|
"for ob in bpy.data.objects:\n"
|
||||||
|
2
hecl
2
hecl
@ -1 +1 @@
|
|||||||
Subproject commit c3403284714be1dbeba736e04194af57ae6e8e17
|
Subproject commit 700b166efaf9d548f1fc9e92f65894a398efee42
|
Loading…
x
Reference in New Issue
Block a user