[Bf-blender-cvs] [2a1127c1993] soc-2019-fast-io: [Fast import/export] Fixed compilation errors

Hugo Sales noreply at git.blender.org
Wed Jun 26 14:35:15 CEST 2019


Commit: 2a1127c199363055dfb6e60e2db34853b74a2429
Author: Hugo Sales
Date:   Wed Jun 26 13:34:14 2019 +0100
Branches: soc-2019-fast-io
https://developer.blender.org/rB2a1127c199363055dfb6e60e2db34853b74a2429

[Fast import/export] Fixed compilation errors

===================================================================

M	source/blender/editors/io/intern/common.cpp
M	source/blender/editors/io/intern/common.hpp

===================================================================

diff --git a/source/blender/editors/io/intern/common.cpp b/source/blender/editors/io/intern/common.cpp
index ee6f59cd5c4..0b19bfd9912 100644
--- a/source/blender/editors/io/intern/common.cpp
+++ b/source/blender/editors/io/intern/common.cpp
@@ -13,6 +13,8 @@ extern "C" {
 #include "BKE_mesh.h"
 #include "BKE_mesh_runtime.h"
 
+#include "RNA_access.h"
+
 #include "bmesh.h"
 #include "bmesh_tools.h"
 
@@ -129,14 +131,14 @@ float get_unit_scale(const Scene *const scene)
   // From collada_internal.cpp
   PointerRNA scene_ptr, unit_settings;
   PropertyRNA *system_ptr, *scale_ptr;
-  RNA_id_pointer_create(&scene.id, &scene_ptr);
+  RNA_id_pointer_create((ID *)&scene->id, &scene_ptr);
 
   unit_settings = RNA_pointer_get(&scene_ptr, "unit_settings");
   system_ptr = RNA_struct_find_property(&unit_settings, "system");
   scale_ptr = RNA_struct_find_property(&unit_settings, "scale_length");
 
   int type = RNA_property_enum_get(&unit_settings, system_ptr);
-  float scale;
+  float scale = 1.0;
 
   switch (type) {
     case USER_UNIT_NONE:
@@ -170,7 +172,7 @@ bool get_final_mesh(const ExportSettings *const settings,
       md.mode |= eModifierMode_DisableTemporary;
 
   float scale_mat[4][4];
-  scale_m4_fl(scale_mat, settings->global_scale * get_unit_scale(scene));
+  scale_m4_fl(scale_mat, settings->global_scale * get_unit_scale(escene));
 
   change_orientation(scale_mat, settings->axis_forward, settings->axis_up);
 
diff --git a/source/blender/editors/io/intern/common.hpp b/source/blender/editors/io/intern/common.hpp
index 275136c43e2..cfc4a625d91 100644
--- a/source/blender/editors/io/intern/common.hpp
+++ b/source/blender/editors/io/intern/common.hpp
@@ -77,6 +77,8 @@ void free_mesh(Mesh *mesh, bool needs_free);
 void name_compat(std::string &ob_name, const std::string &mesh_name);
 std::string get_version_string();
 
+float get_unit_scale(const Scene *const scene);
+
 void export_start(bContext *C, ExportSettings *const settings);
 bool export_end(bContext *C, ExportSettings *const settings);



More information about the Bf-blender-cvs mailing list