metaforce/DataSpec/Blender/BlenderSupport.cpp

25 lines
629 B
C++
Raw Normal View History

2017-12-29 08:08:12 +00:00
#include <cstdint>
#include "hecl/Blender/Connection.hpp"
#include "BlenderSupport.hpp"
extern "C" uint8_t RETRO_MASTER_SHADER[];
extern "C" size_t RETRO_MASTER_SHADER_SZ;
2017-12-29 08:08:12 +00:00
namespace DataSpec::Blender
{
2016-03-04 23:04:53 +00:00
bool BuildMasterShader(const hecl::ProjectPath& path)
{
2017-12-29 08:08:12 +00:00
hecl::blender::Connection& conn = hecl::blender::Connection::SharedConnection();
if (!conn.createBlend(path, hecl::blender::BlendType::None))
return false;
{
2017-12-29 08:08:12 +00:00
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
os << RETRO_MASTER_SHADER;
os << "make_master_shader_library()\n";
}
return conn.saveBlend();
}
}