diff options
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r-- | intern/cycles/blender/blender_util.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index b01fa81ee40..b5a76836bed 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -27,7 +27,7 @@ #include "util_vector.h" /* Hacks to hook into Blender API - todo: clean this up ... */ + * todo: clean this up ... */ extern "C" { @@ -53,6 +53,8 @@ int rna_Object_is_deform_modified(void *ob, void *scene, int settings); void BLI_timestr(double _time, char *str); void rna_ColorRamp_eval(void *coba, float position, float color[4]); void rna_Scene_frame_set(void *scene, int frame, float subframe); +void BKE_image_user_frame_calc(void *iuser, int cfra, int fieldnr); +void BKE_image_user_file_path(void *iuser, void *ima, char *path); } @@ -101,6 +103,14 @@ static inline bool BKE_object_is_deform_modified(BL::Object self, BL::Scene scen return rna_Object_is_deform_modified(self.ptr.data, scene.ptr.data, (preview)? (1<<0): (1<<1))? true: false; } +static inline string image_user_file_path(BL::ImageUser iuser, BL::Image ima, int cfra) +{ + char filepath[1024]; + BKE_image_user_frame_calc(iuser.ptr.data, cfra, 0); + BKE_image_user_file_path(iuser.ptr.data, ima.ptr.data, filepath); + return string(filepath); +} + static inline void scene_frame_set(BL::Scene scene, int frame) { rna_Scene_frame_set(scene.ptr.data, frame, 0.0f); @@ -113,7 +123,7 @@ static inline Transform get_transform(BL::Array<float, 16> array) Transform tfm; /* we assume both types to be just 16 floats, and transpose because blender - use column major matrix order while we use row major */ + * use column major matrix order while we use row major */ memcpy(&tfm, &array, sizeof(float)*16); tfm = transform_transpose(tfm); @@ -156,12 +166,14 @@ static inline uint get_layer(BL::Array<int, 20> array) return layer; } -/*static inline float3 get_float3(PointerRNA& ptr, const char *name) +#if 0 +static inline float3 get_float3(PointerRNA& ptr, const char *name) { float3 f; RNA_float_get_array(&ptr, name, &f.x); return f; -}*/ +} +#endif static inline bool get_boolean(PointerRNA& ptr, const char *name) { |