Support for SLERP blender fork

This commit is contained in:
Jack Andersen 2016-04-25 14:47:11 -10:00
parent e6cf759477
commit f581ed3127
4 changed files with 23 additions and 2 deletions

View File

@ -360,6 +360,17 @@ BlenderConnection::BlenderConnection(int verbosityLevel)
} }
_writeLine("ACK"); _writeLine("ACK");
_readLine(lineBuf, 7);
if (!strcmp(lineBuf, "SLERP0"))
m_hasSlerp = false;
else if (!strcmp(lineBuf, "SLERP1"))
m_hasSlerp = true;
else
{
_closePipe();
BlenderLog.report(logvisor::Fatal, "read '%s' from blender; expected 'SLERP(0|1)'", lineBuf);
}
break; break;
} }
} }

View File

@ -56,6 +56,7 @@ private:
#endif #endif
int m_readpipe[2]; int m_readpipe[2];
int m_writepipe[2]; int m_writepipe[2];
bool m_hasSlerp;
BlendType m_loadedType = BlendType::None; BlendType m_loadedType = BlendType::None;
bool m_loadedRigged = false; bool m_loadedRigged = false;
ProjectPath m_loadedBlend; ProjectPath m_loadedBlend;
@ -69,6 +70,8 @@ public:
BlenderConnection(int verbosityLevel=1); BlenderConnection(int verbosityLevel=1);
~BlenderConnection(); ~BlenderConnection();
bool hasSLERP() const {return m_hasSlerp;}
bool createBlend(const ProjectPath& path, BlendType type); bool createBlend(const ProjectPath& path, BlendType type);
BlendType getBlendType() const {return m_loadedType;} BlendType getBlendType() const {return m_loadedType;}
bool getRigged() const {return m_loadedRigged;} bool getRigged() const {return m_loadedRigged;}
@ -267,6 +270,7 @@ public:
{ {
return ANIMOutStream(m_parent); return ANIMOutStream(m_parent);
} }
BlenderConnection& getConnection() {return *m_parent;}
}; };
PyOutStream beginPythonOut(bool deleteOnError=false) PyOutStream beginPythonOut(bool deleteOnError=false)
{ {

View File

@ -167,13 +167,13 @@ class SACTAction_load(bpy.types.Operator):
bpy.context.scene.render.fps = 60 bpy.context.scene.render.fps = 60
bpy.context.scene.render.frame_map_old = action_obj.hecl_fps bpy.context.scene.render.frame_map_old = action_obj.hecl_fps
bpy.context.scene.render.frame_map_new = 60 bpy.context.scene.render.frame_map_new = 60
bpy.context.scene.frame_start = 2 bpy.context.scene.frame_start = 0
bpy.context.scene.frame_end = action_obj.frame_range[1] * (60 / action_obj.hecl_fps) bpy.context.scene.frame_end = action_obj.frame_range[1] * (60 / action_obj.hecl_fps)
else: else:
bpy.context.scene.render.fps = action_obj.hecl_fps bpy.context.scene.render.fps = action_obj.hecl_fps
bpy.context.scene.render.frame_map_old = action_obj.hecl_fps bpy.context.scene.render.frame_map_old = action_obj.hecl_fps
bpy.context.scene.render.frame_map_new = action_obj.hecl_fps bpy.context.scene.render.frame_map_new = action_obj.hecl_fps
bpy.context.scene.frame_start = 1 bpy.context.scene.frame_start = 0
bpy.context.scene.frame_end = action_obj.frame_range[1] bpy.context.scene.frame_end = action_obj.frame_range[1]
# Events # Events

View File

@ -66,6 +66,12 @@ ackbytes = readpipeline()
if ackbytes != b'ACK': if ackbytes != b'ACK':
quitblender() quitblender()
# slerp branch check
if b'quat-slerp' in bpy.app.build_branch:
writepipeline(b'SLERP1')
else:
writepipeline(b'SLERP0')
# Count brackets # Count brackets
def count_brackets(linestr): def count_brackets(linestr):
bracket_count = 0 bracket_count = 0