Alembic: quiet compilation warnings on Windows.

Most of them are harmless implicit conversions (e.g. Alembic deals with
doubles for storing time information when Blender uses both ints and
floats/doubles) or class/struct mismatch on forward declarations.
This commit is contained in:
Kévin Dietrich 2016-12-01 08:32:02 +01:00
parent 05b181fbc5
commit 58877d6d08
11 changed files with 31 additions and 29 deletions

View File

@ -138,11 +138,11 @@ void AbcCameraReader::readObjectData(Main *bmain, float time)
bcam->stereo.convergence_distance = convergence_plane.getValue(sample_sel);
}
const float lens = cam_sample.getFocalLength();
const float apperture_x = cam_sample.getHorizontalAperture();
const float apperture_y = cam_sample.getVerticalAperture();
const float h_film_offset = cam_sample.getHorizontalFilmOffset();
const float v_film_offset = cam_sample.getVerticalFilmOffset();
const float lens = static_cast<float>(cam_sample.getFocalLength());
const float apperture_x = static_cast<float>(cam_sample.getHorizontalAperture());
const float apperture_y = static_cast<float>(cam_sample.getVerticalAperture());
const float h_film_offset = static_cast<float>(cam_sample.getHorizontalFilmOffset());
const float v_film_offset = static_cast<float>(cam_sample.getVerticalFilmOffset());
const float film_aspect = apperture_x / apperture_y;
bcam->lens = lens;
@ -150,10 +150,10 @@ void AbcCameraReader::readObjectData(Main *bmain, float time)
bcam->sensor_y = apperture_y * 10;
bcam->shiftx = h_film_offset / apperture_x;
bcam->shifty = v_film_offset / apperture_y / film_aspect;
bcam->clipsta = max_ff(0.1f, cam_sample.getNearClippingPlane());
bcam->clipend = cam_sample.getFarClippingPlane();
bcam->gpu_dof.focus_distance = cam_sample.getFocusDistance();
bcam->gpu_dof.fstop = cam_sample.getFStop();
bcam->clipsta = max_ff(0.1f, static_cast<float>(cam_sample.getNearClippingPlane()));
bcam->clipend = static_cast<float>(cam_sample.getFarClippingPlane());
bcam->gpu_dof.focus_distance = static_cast<float>(cam_sample.getFocusDistance());
bcam->gpu_dof.fstop = static_cast<float>(cam_sample.getFStop());
m_object = BKE_object_add_only_object(bmain, OB_CAMERA, m_object_name.c_str());
m_object->data = bcam;

View File

@ -26,6 +26,7 @@
#define __ABC_CUSTOMDATA_H__
#include <Alembic/Abc/All.h>
#include <Alembic/AbcGeom/All.h>
struct CustomData;
struct MLoop;
@ -65,8 +66,8 @@ struct CDStreamConfig {
float weight;
float time;
int index;
int ceil_index;
Alembic::AbcGeom::index_t index;
Alembic::AbcGeom::index_t ceil_index;
CDStreamConfig()
: mloop(NULL)

View File

@ -176,13 +176,13 @@ void AbcExporter::getShutterSamples(double step, bool time_relative,
/* sample all frame */
if (shutter_open == 0.0 && shutter_close == 1.0) {
for (double t = 0; t < 1.0; t += step) {
for (double t = 0.0; t < 1.0; t += step) {
samples.push_back((t + m_settings.frame_start) / time_factor);
}
}
else {
/* sample between shutter open & close */
const int nsamples = std::max((1.0 / step) - 1.0, 1.0);
const int nsamples = static_cast<int>(std::max((1.0 / step) - 1.0, 1.0));
const double time_inc = (shutter_close - shutter_open) / nsamples;
for (double t = shutter_open; t <= shutter_close; t += time_inc) {
@ -217,7 +217,7 @@ void AbcExporter::getFrameSet(double step, std::set<double> &frames)
getShutterSamples(step, false, shutter_samples);
for (int frame = m_settings.frame_start; frame <= m_settings.frame_end; ++frame) {
for (double frame = m_settings.frame_start; frame <= m_settings.frame_end; frame += 1.0) {
for (int j = 0, e = shutter_samples.size(); j < e; ++j) {
frames.insert(frame + shutter_samples[j]);
}
@ -238,9 +238,9 @@ void AbcExporter::operator()(Main *bmain, float &progress, bool &was_canceled)
}
Scene *scene = m_scene;
const int fps = FPS;
const double fps = FPS;
char buf[16];
snprintf(buf, 15, "%d", fps);
snprintf(buf, 15, "%f", fps);
const std::string str_fps = buf;
Alembic::AbcCoreAbstract::MetaData md;
@ -578,7 +578,7 @@ AbcTransformWriter *AbcExporter::getXForm(const std::string &name)
void AbcExporter::setCurrentFrame(Main *bmain, double t)
{
m_scene->r.cfra = std::floor(t);
m_scene->r.subframe = t - m_scene->r.cfra;
m_scene->r.cfra = static_cast<int>(t);
m_scene->r.subframe = static_cast<float>(t) - m_scene->r.cfra;
BKE_scene_update_for_newframe(bmain->eval_ctx, bmain, m_scene, m_scene->lay);
}

View File

@ -952,7 +952,7 @@ static void read_mesh_sample(ImportSettings *settings,
if (config.weight != 0.0f) {
Alembic::AbcGeom::IPolyMeshSchema::Sample ceil_sample;
schema.get(ceil_sample, Alembic::Abc::ISampleSelector(static_cast<Alembic::AbcCoreAbstract::index_t>(config.ceil_index)));
schema.get(ceil_sample, Alembic::Abc::ISampleSelector(config.ceil_index));
abc_mesh_data.ceil_positions = ceil_sample.getPositions();
}
@ -1186,7 +1186,7 @@ static void read_subd_sample(ImportSettings *settings,
if (config.weight != 0.0f) {
Alembic::AbcGeom::ISubDSchema::Sample ceil_sample;
schema.get(ceil_sample, Alembic::Abc::ISampleSelector(static_cast<Alembic::AbcCoreAbstract::index_t>(config.ceil_index)));
schema.get(ceil_sample, Alembic::Abc::ISampleSelector(config.ceil_index));
abc_mesh_data.ceil_positions = ceil_sample.getPositions();
}

View File

@ -170,13 +170,13 @@ static Imath::M44d blend_matrices(const Imath::M44d &m0, const Imath::M44d &m1,
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
mat0[i][j] = m0[i][j];
mat0[i][j] = static_cast<float>(m0[i][j]);
}
}
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
mat1[i][j] = m1[i][j];
mat1[i][j] = static_cast<float>(m1[i][j]);
}
}

View File

@ -76,7 +76,7 @@ private:
/* ************************************************************************** */
class CacheFile;
struct CacheFile;
struct ImportSettings {
bool do_convert_mat;

View File

@ -189,7 +189,8 @@ void read_points_sample(const IPointsSchema &schema,
N3fArraySamplePtr vnormals;
if (has_property(prop, "N")) {
const IN3fArrayProperty &normals_prop = IN3fArrayProperty(prop, "N", time);
const Alembic::Util::uint32_t itime = static_cast<Alembic::Util::uint32_t>(time);
const IN3fArrayProperty &normals_prop = IN3fArrayProperty(prop, "N", itime);
if (normals_prop) {
vnormals = normals_prop.getValue(selector);

View File

@ -28,7 +28,7 @@
#include "abc_object.h"
#include "abc_customdata.h"
class ParticleSystem;
struct ParticleSystem;
/* ************************************************************************** */

View File

@ -215,7 +215,7 @@ void convert_matrix(const Imath::M44d &xform, Object *ob,
{
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
r_mat[i][j] = xform[i][j];
r_mat[i][j] = static_cast<float>(xform[i][j]);
}
}

View File

@ -39,7 +39,7 @@ struct CacheReader {
using Alembic::Abc::chrono_t;
class AbcObjectReader;
class ImportSettings;
struct ImportSettings;
struct ID;
struct Object;

View File

@ -625,8 +625,8 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
CFRA = SFRA;
}
else if (min_time < max_time) {
SFRA = min_time * FPS;
EFRA = max_time * FPS;
SFRA = static_cast<int>(min_time * FPS);
EFRA = static_cast<int>(max_time * FPS);
CFRA = SFRA;
}
}