2017-12-29 00:08:12 -08:00
|
|
|
#include <cstdint>
|
|
|
|
#include "hecl/Blender/Connection.hpp"
|
2015-08-04 14:35:41 -07:00
|
|
|
#include "BlenderSupport.hpp"
|
|
|
|
|
|
|
|
extern "C" uint8_t RETRO_MASTER_SHADER[];
|
|
|
|
extern "C" size_t RETRO_MASTER_SHADER_SZ;
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
namespace DataSpec::Blender {
|
2015-08-04 14:35:41 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
bool BuildMasterShader(const hecl::ProjectPath& path) {
|
|
|
|
hecl::blender::Connection& conn = hecl::blender::Connection::SharedConnection();
|
|
|
|
if (!conn.createBlend(path, hecl::blender::BlendType::None))
|
|
|
|
return false;
|
|
|
|
{
|
|
|
|
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
|
2019-10-01 00:38:03 -07:00
|
|
|
os << std::string_view((char*)RETRO_MASTER_SHADER, RETRO_MASTER_SHADER_SZ);
|
|
|
|
os << "make_master_shader_library()\n"sv;
|
2018-12-07 21:30:43 -08:00
|
|
|
}
|
|
|
|
return conn.saveBlend();
|
2015-08-04 14:35:41 -07:00
|
|
|
}
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
} // namespace DataSpec::Blender
|