Cleanup: use "r_" prefixed return arguments
This commit is contained in:
@@ -50,9 +50,9 @@ struct PropertyRNA;
|
||||
struct bContext;
|
||||
|
||||
/**
|
||||
* Get allocation size of a given data-block type and optionally allocation name.
|
||||
* Get allocation size of a given data-block type and optionally allocation `r_name`.
|
||||
*/
|
||||
size_t BKE_libblock_get_alloc_info(short type, const char **name);
|
||||
size_t BKE_libblock_get_alloc_info(short type, const char **r_name);
|
||||
/**
|
||||
* Allocates and returns memory of the right size for the specified block type,
|
||||
* initialized to zero.
|
||||
|
||||
@@ -1275,19 +1275,19 @@ void BKE_main_lib_objects_recalc_all(Main *bmain)
|
||||
*
|
||||
* **************************** */
|
||||
|
||||
size_t BKE_libblock_get_alloc_info(short type, const char **name)
|
||||
size_t BKE_libblock_get_alloc_info(short type, const char **r_name)
|
||||
{
|
||||
const IDTypeInfo *id_type = BKE_idtype_get_info_from_idcode(type);
|
||||
|
||||
if (id_type == nullptr) {
|
||||
if (name != nullptr) {
|
||||
*name = nullptr;
|
||||
if (r_name != nullptr) {
|
||||
*r_name = nullptr;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (name != nullptr) {
|
||||
*name = id_type->name;
|
||||
if (r_name != nullptr) {
|
||||
*r_name = id_type->name;
|
||||
}
|
||||
return id_type->struct_size;
|
||||
}
|
||||
|
||||
@@ -4298,16 +4298,16 @@ static void node_type_base_defaults(bNodeType *ntype)
|
||||
/* allow this node for any tree type */
|
||||
static bool node_poll_default(const bNodeType * /*ntype*/,
|
||||
const bNodeTree * /*ntree*/,
|
||||
const char ** /*disabled_hint*/)
|
||||
const char ** /*r_disabled_hint*/)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool node_poll_instance_default(const bNode *node,
|
||||
const bNodeTree *ntree,
|
||||
const char **disabled_hint)
|
||||
const char **r_disabled_hint)
|
||||
{
|
||||
return node->typeinfo->poll(node->typeinfo, ntree, disabled_hint);
|
||||
return node->typeinfo->poll(node->typeinfo, ntree, r_disabled_hint);
|
||||
}
|
||||
|
||||
void node_type_base(bNodeType *ntype, const int type, const char *name, const short nclass)
|
||||
|
||||
@@ -115,7 +115,7 @@ int BLI_delete(const char *path, bool dir, bool recursive) ATTR_NONNULL();
|
||||
*
|
||||
* \return zero on success (matching 'remove' behavior).
|
||||
*/
|
||||
int BLI_delete_soft(const char *filepath, const char **error_message) ATTR_NONNULL();
|
||||
int BLI_delete_soft(const char *filepath, const char **r_error_message) ATTR_NONNULL();
|
||||
#if 0 /* Unused */
|
||||
int BLI_create_symlink(const char *path, const char *path_dst) ATTR_NONNULL();
|
||||
#endif
|
||||
|
||||
@@ -602,7 +602,7 @@ int BLI_access(const char *filepath, int mode)
|
||||
return uaccess(filepath, mode);
|
||||
}
|
||||
|
||||
static bool delete_soft(const wchar_t *path_16, const char **error_message)
|
||||
static bool delete_soft(const wchar_t *path_16, const char **r_error_message)
|
||||
{
|
||||
/* Deletes file or directory to recycling bin. The latter moves all contained files and
|
||||
* directories recursively to the recycling bin as well. */
|
||||
@@ -635,30 +635,30 @@ static bool delete_soft(const wchar_t *path_16, const char **error_message)
|
||||
hr = pfo->PerformOperations();
|
||||
|
||||
if (FAILED(hr)) {
|
||||
*error_message = "Failed to prepare delete operation";
|
||||
*r_error_message = "Failed to prepare delete operation";
|
||||
}
|
||||
}
|
||||
else {
|
||||
*error_message = "Failed to prepare delete operation";
|
||||
*r_error_message = "Failed to prepare delete operation";
|
||||
}
|
||||
psi->Release();
|
||||
}
|
||||
else {
|
||||
*error_message = "Failed to parse path";
|
||||
*r_error_message = "Failed to parse path";
|
||||
}
|
||||
}
|
||||
else {
|
||||
*error_message = "Failed to set operation flags";
|
||||
*r_error_message = "Failed to set operation flags";
|
||||
}
|
||||
pfo->Release();
|
||||
}
|
||||
else {
|
||||
*error_message = "Failed to create FileOperation instance";
|
||||
*r_error_message = "Failed to create FileOperation instance";
|
||||
}
|
||||
CoUninitialize();
|
||||
}
|
||||
else {
|
||||
*error_message = "Failed to initialize COM";
|
||||
*r_error_message = "Failed to initialize COM";
|
||||
}
|
||||
|
||||
return FAILED(hr);
|
||||
@@ -750,7 +750,7 @@ int BLI_delete(const char *path, bool dir, bool recursive)
|
||||
/**
|
||||
* Moves the files or directories to the recycling bin.
|
||||
*/
|
||||
int BLI_delete_soft(const char *file, const char **error_message)
|
||||
int BLI_delete_soft(const char *file, const char **r_error_message)
|
||||
{
|
||||
int err;
|
||||
|
||||
@@ -758,7 +758,7 @@ int BLI_delete_soft(const char *file, const char **error_message)
|
||||
|
||||
UTF16_ENCODE(file);
|
||||
|
||||
err = delete_soft(file_16, error_message);
|
||||
err = delete_soft(file_16, r_error_message);
|
||||
|
||||
UTF16_UN_ENCODE(file);
|
||||
|
||||
@@ -1159,7 +1159,7 @@ static int delete_single_file(const char *from, const char * /*to*/)
|
||||
}
|
||||
|
||||
# ifdef __APPLE__
|
||||
static int delete_soft(const char *filepath, const char **error_message)
|
||||
static int delete_soft(const char *filepath, const char **r_error_message)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
@@ -1190,7 +1190,7 @@ static int delete_soft(const char *filepath, const char **error_message)
|
||||
ret = 0;
|
||||
}
|
||||
else {
|
||||
*error_message = "The Cocoa API call to delete file or directory failed";
|
||||
*r_error_message = "The Cocoa API call to delete file or directory failed";
|
||||
}
|
||||
|
||||
SEL drainSel = sel_registerName("drain");
|
||||
@@ -1199,7 +1199,7 @@ static int delete_soft(const char *filepath, const char **error_message)
|
||||
return ret;
|
||||
}
|
||||
# else
|
||||
static int delete_soft(const char *filepath, const char **error_message)
|
||||
static int delete_soft(const char *filepath, const char **r_error_message)
|
||||
{
|
||||
const char *args[5];
|
||||
const char *process_failed;
|
||||
@@ -1233,7 +1233,7 @@ static int delete_soft(const char *filepath, const char **error_message)
|
||||
|
||||
int pid = fork();
|
||||
if (UNLIKELY(pid == -1)) {
|
||||
*error_message = errno ? strerror(errno) : "unable to fork process";
|
||||
*r_error_message = errno ? strerror(errno) : "unable to fork process";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1256,7 +1256,7 @@ static int delete_soft(const char *filepath, const char **error_message)
|
||||
if (WIFEXITED(wstatus)) {
|
||||
const int errno_child = WEXITSTATUS(wstatus);
|
||||
if (errno_child) {
|
||||
*error_message = process_failed;
|
||||
*r_error_message = process_failed;
|
||||
result = -1;
|
||||
|
||||
/* Forward to the error so the caller may set the message. */
|
||||
@@ -1264,7 +1264,7 @@ static int delete_soft(const char *filepath, const char **error_message)
|
||||
}
|
||||
}
|
||||
else {
|
||||
*error_message =
|
||||
*r_error_message =
|
||||
"Blender may not support moving files or directories to trash on your system.";
|
||||
result = -1;
|
||||
}
|
||||
@@ -1321,11 +1321,11 @@ int BLI_delete(const char *path, bool dir, bool recursive)
|
||||
return remove(path);
|
||||
}
|
||||
|
||||
int BLI_delete_soft(const char *filepath, const char **error_message)
|
||||
int BLI_delete_soft(const char *filepath, const char **r_error_message)
|
||||
{
|
||||
BLI_assert(!BLI_path_is_rel(filepath));
|
||||
|
||||
return delete_soft(filepath, error_message);
|
||||
return delete_soft(filepath, r_error_message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -63,7 +63,7 @@ void BMO_error_clear(BMesh *bm);
|
||||
|
||||
/* Catches an error raised by the op pointed to by catchop. */
|
||||
/* Not yet implemented. */
|
||||
// int BMO_error_catch_op(BMesh *bm, BMOperator *catchop, char **msg);
|
||||
// int BMO_error_catch_op(BMesh *bm, BMOperator *catchop, char **r_msg);
|
||||
|
||||
#define BM_ELEM_INDEX_VALIDATE(_bm, _msg_a, _msg_b) \
|
||||
BM_mesh_elem_index_validate(_bm, __FILE__ ":" STRINGIFY(__LINE__), __func__, _msg_a, _msg_b)
|
||||
|
||||
@@ -636,7 +636,7 @@ void heat_bone_weighting(Object *ob,
|
||||
float (*root)[3],
|
||||
float (*tip)[3],
|
||||
const int *selected,
|
||||
const char **error_str)
|
||||
const char **r_error_str)
|
||||
{
|
||||
using namespace blender;
|
||||
LaplacianSystem *sys;
|
||||
@@ -653,7 +653,7 @@ void heat_bone_weighting(Object *ob,
|
||||
bool use_vert_sel = (mesh->editflag & ME_EDIT_PAINT_VERT_SEL) != 0;
|
||||
bool use_face_sel = (mesh->editflag & ME_EDIT_PAINT_FACE_SEL) != 0;
|
||||
|
||||
*error_str = nullptr;
|
||||
*r_error_str = nullptr;
|
||||
|
||||
/* bone heat needs triangulated faces */
|
||||
tris_num = poly_to_tri_count(mesh->faces_num, mesh->corners_num);
|
||||
@@ -799,8 +799,8 @@ void heat_bone_weighting(Object *ob,
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (*error_str == nullptr) {
|
||||
*error_str = N_("Bone Heat Weighting: failed to find solution for one or more bones");
|
||||
else if (*r_error_str == nullptr) {
|
||||
*r_error_str = N_("Bone Heat Weighting: failed to find solution for one or more bones");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ void heat_bone_weighting(struct Object *ob,
|
||||
float (*root)[3],
|
||||
float (*tip)[3],
|
||||
const int *selected,
|
||||
const char **error_str);
|
||||
const char **r_error_str);
|
||||
|
||||
#ifdef RIGID_DEFORM
|
||||
/* As-Rigid-As-Possible Deformation */
|
||||
|
||||
@@ -849,9 +849,9 @@ static bool associate_blend_poll(bContext *C)
|
||||
}
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
static bool associate_blend(bool do_register, bool all_users, char **error_msg)
|
||||
static bool associate_blend(bool do_register, bool all_users, char **r_error_msg)
|
||||
{
|
||||
const bool result = WM_platform_associate_set(do_register, all_users, error_msg);
|
||||
const bool result = WM_platform_associate_set(do_register, all_users, r_error_msg);
|
||||
# ifdef WIN32
|
||||
if ((result == false) &&
|
||||
/* For some reason the message box isn't shown in this case. */
|
||||
|
||||
@@ -137,14 +137,14 @@ void ABC_read_geometry(CacheReader *reader,
|
||||
Object *ob,
|
||||
blender::bke::GeometrySet &geometry_set,
|
||||
const ABCReadParams *params,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
#endif
|
||||
|
||||
bool ABC_mesh_topology_changed(struct CacheReader *reader,
|
||||
struct Object *ob,
|
||||
const struct Mesh *existing_mesh,
|
||||
double time,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
|
||||
void ABC_CacheReader_incref(struct CacheReader *reader);
|
||||
void ABC_CacheReader_free(struct CacheReader *reader);
|
||||
|
||||
@@ -45,17 +45,17 @@ bool AbcCameraReader::valid() const
|
||||
bool AbcCameraReader::accepts_object_type(
|
||||
const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const
|
||||
const char **r_err_str) const
|
||||
{
|
||||
if (!Alembic::AbcGeom::ICamera::matches(alembic_header)) {
|
||||
*err_str = RPT_(
|
||||
*r_err_str = RPT_(
|
||||
"Object type mismatch, Alembic object path pointed to Camera when importing, but not any "
|
||||
"more");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ob->type != OB_CAMERA) {
|
||||
*err_str = RPT_("Object type mismatch, Alembic object path points to Camera");
|
||||
*r_err_str = RPT_("Object type mismatch, Alembic object path points to Camera");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class AbcCameraReader final : public AbcObjectReader {
|
||||
bool valid() const override;
|
||||
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const override;
|
||||
const char **r_err_str) const override;
|
||||
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
|
||||
};
|
||||
|
||||
@@ -320,17 +320,17 @@ bool AbcCurveReader::valid() const
|
||||
bool AbcCurveReader::accepts_object_type(
|
||||
const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const
|
||||
const char **r_err_str) const
|
||||
{
|
||||
if (!Alembic::AbcGeom::ICurves::matches(alembic_header)) {
|
||||
*err_str = RPT_(
|
||||
*r_err_str = RPT_(
|
||||
"Object type mismatch, Alembic object path pointed to Curves when importing, but not "
|
||||
"anymore.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ob->type != OB_CURVES) {
|
||||
*err_str = RPT_("Object type mismatch, Alembic object path points to Curves.");
|
||||
*r_err_str = RPT_("Object type mismatch, Alembic object path points to Curves.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ void AbcCurveReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
int /*read_flag*/,
|
||||
const char * /*velocity_name*/,
|
||||
const float /*velocity_scale*/,
|
||||
const char ** /*err_str*/)
|
||||
const char ** /*r_err_str*/)
|
||||
{
|
||||
Curves *curves = geometry_set.get_curves_for_write();
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class AbcCurveReader final : public AbcObjectReader {
|
||||
bool valid() const override;
|
||||
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const override;
|
||||
const char **r_err_str) const override;
|
||||
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
|
||||
|
||||
@@ -35,7 +35,7 @@ class AbcCurveReader final : public AbcObjectReader {
|
||||
int read_flag,
|
||||
const char *velocity_name,
|
||||
float velocity_scale,
|
||||
const char **err_str) override;
|
||||
const char **r_err_str) override;
|
||||
|
||||
void read_curves_sample(Curves *curves_id,
|
||||
const Alembic::AbcGeom::ICurvesSchema &schema,
|
||||
|
||||
@@ -604,17 +604,17 @@ void AbcMeshReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelec
|
||||
bool AbcMeshReader::accepts_object_type(
|
||||
const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const
|
||||
const char **r_err_str) const
|
||||
{
|
||||
if (!Alembic::AbcGeom::IPolyMesh::matches(alembic_header)) {
|
||||
*err_str = RPT_(
|
||||
*r_err_str = RPT_(
|
||||
"Object type mismatch, Alembic object path pointed to PolyMesh when importing, but not "
|
||||
"any more");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ob->type != OB_MESH) {
|
||||
*err_str = RPT_("Object type mismatch, Alembic object path points to PolyMesh");
|
||||
*r_err_str = RPT_("Object type mismatch, Alembic object path points to PolyMesh");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -689,7 +689,7 @@ void AbcMeshReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
const int read_flag,
|
||||
const char *velocity_name,
|
||||
const float velocity_scale,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
Mesh *mesh = geometry_set.get_mesh_for_write();
|
||||
|
||||
@@ -697,7 +697,8 @@ void AbcMeshReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
return;
|
||||
}
|
||||
|
||||
Mesh *new_mesh = read_mesh(mesh, sample_sel, read_flag, velocity_name, velocity_scale, err_str);
|
||||
Mesh *new_mesh = read_mesh(
|
||||
mesh, sample_sel, read_flag, velocity_name, velocity_scale, r_err_str);
|
||||
|
||||
geometry_set.replace_mesh(new_mesh);
|
||||
}
|
||||
@@ -707,15 +708,15 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
const int read_flag,
|
||||
const char *velocity_name,
|
||||
const float velocity_scale,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
IPolyMeshSchema::Sample sample;
|
||||
try {
|
||||
sample = m_schema.getValue(sample_sel);
|
||||
}
|
||||
catch (Alembic::Util::Exception &ex) {
|
||||
if (err_str != nullptr) {
|
||||
*err_str = RPT_("Error reading mesh sample; more detail on the console");
|
||||
if (r_err_str != nullptr) {
|
||||
*r_err_str = RPT_("Error reading mesh sample; more detail on the console");
|
||||
}
|
||||
printf("Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n",
|
||||
m_iobject.getFullName().c_str(),
|
||||
@@ -734,8 +735,8 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
const int loop_count = face_indices->size();
|
||||
/* This is the same test as in poly_to_tri_count(). */
|
||||
if (poly_count > 0 && loop_count < poly_count * 2) {
|
||||
if (err_str != nullptr) {
|
||||
*err_str = RPT_("Invalid mesh; more detail on the console");
|
||||
if (r_err_str != nullptr) {
|
||||
*r_err_str = RPT_("Invalid mesh; more detail on the console");
|
||||
}
|
||||
printf("Alembic: invalid mesh sample for '%s/%s' at time %f, less than 2 loops per face\n",
|
||||
m_iobject.getFullName().c_str(),
|
||||
@@ -767,8 +768,8 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
{
|
||||
settings.read_flag = MOD_MESHSEQ_READ_VERT;
|
||||
|
||||
if (err_str) {
|
||||
*err_str = RPT_(
|
||||
if (r_err_str) {
|
||||
*r_err_str = RPT_(
|
||||
"Topology has changed, perhaps by triangulating the mesh. Only vertices will be "
|
||||
"read!");
|
||||
}
|
||||
@@ -778,7 +779,7 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh;
|
||||
CDStreamConfig config = get_config(mesh_to_export);
|
||||
config.time = sample_sel.getRequestedTime();
|
||||
config.modifier_error_message = err_str;
|
||||
config.modifier_error_message = r_err_str;
|
||||
|
||||
read_mesh_sample(m_iobject.getFullName(), &settings, m_schema, sample_sel, config);
|
||||
|
||||
@@ -992,17 +993,17 @@ bool AbcSubDReader::valid() const
|
||||
bool AbcSubDReader::accepts_object_type(
|
||||
const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const
|
||||
const char **r_err_str) const
|
||||
{
|
||||
if (!Alembic::AbcGeom::ISubD::matches(alembic_header)) {
|
||||
*err_str = RPT_(
|
||||
*r_err_str = RPT_(
|
||||
"Object type mismatch, Alembic object path pointed to SubD when importing, but not any "
|
||||
"more");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ob->type != OB_MESH) {
|
||||
*err_str = RPT_("Object type mismatch, Alembic object path points to SubD");
|
||||
*r_err_str = RPT_("Object type mismatch, Alembic object path points to SubD");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1052,15 +1053,15 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh,
|
||||
const int read_flag,
|
||||
const char *velocity_name,
|
||||
const float velocity_scale,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
ISubDSchema::Sample sample;
|
||||
try {
|
||||
sample = m_schema.getValue(sample_sel);
|
||||
}
|
||||
catch (Alembic::Util::Exception &ex) {
|
||||
if (err_str != nullptr) {
|
||||
*err_str = RPT_("Error reading mesh sample; more detail on the console");
|
||||
if (r_err_str != nullptr) {
|
||||
*r_err_str = RPT_("Error reading mesh sample; more detail on the console");
|
||||
}
|
||||
printf("Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n",
|
||||
m_iobject.getFullName().c_str(),
|
||||
@@ -1096,8 +1097,8 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh,
|
||||
{
|
||||
settings.read_flag = MOD_MESHSEQ_READ_VERT;
|
||||
|
||||
if (err_str) {
|
||||
*err_str = RPT_(
|
||||
if (r_err_str) {
|
||||
*r_err_str = RPT_(
|
||||
"Topology has changed, perhaps by triangulating the mesh. Only vertices will be "
|
||||
"read!");
|
||||
}
|
||||
@@ -1108,7 +1109,7 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh,
|
||||
Mesh *mesh_to_export = new_mesh ? new_mesh : existing_mesh;
|
||||
CDStreamConfig config = get_config(mesh_to_export);
|
||||
config.time = sample_sel.getRequestedTime();
|
||||
config.modifier_error_message = err_str;
|
||||
config.modifier_error_message = r_err_str;
|
||||
read_subd_sample(m_iobject.getFullName(), &settings, m_schema, sample_sel, config);
|
||||
|
||||
return mesh_to_export;
|
||||
@@ -1119,7 +1120,7 @@ void AbcSubDReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
const int read_flag,
|
||||
const char *velocity_name,
|
||||
const float velocity_scale,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
Mesh *mesh = geometry_set.get_mesh_for_write();
|
||||
|
||||
@@ -1127,7 +1128,8 @@ void AbcSubDReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
return;
|
||||
}
|
||||
|
||||
Mesh *new_mesh = read_mesh(mesh, sample_sel, read_flag, velocity_name, velocity_scale, err_str);
|
||||
Mesh *new_mesh = read_mesh(
|
||||
mesh, sample_sel, read_flag, velocity_name, velocity_scale, r_err_str);
|
||||
|
||||
geometry_set.replace_mesh(new_mesh);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class AbcMeshReader final : public AbcObjectReader {
|
||||
bool valid() const override;
|
||||
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const override;
|
||||
const char **r_err_str) const override;
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
|
||||
|
||||
struct Mesh *read_mesh(struct Mesh *existing_mesh,
|
||||
@@ -35,14 +35,14 @@ class AbcMeshReader final : public AbcObjectReader {
|
||||
int read_flag,
|
||||
const char *velocity_name,
|
||||
float velocity_scale,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
|
||||
void read_geometry(bke::GeometrySet &geometry_set,
|
||||
const Alembic::Abc::ISampleSelector &sample_sel,
|
||||
int read_flag,
|
||||
const char *velocity_name,
|
||||
float velocity_scale,
|
||||
const char **err_str) override;
|
||||
const char **r_err_str) override;
|
||||
|
||||
bool topology_changed(const Mesh *existing_mesh,
|
||||
const Alembic::Abc::ISampleSelector &sample_sel) override;
|
||||
@@ -66,7 +66,7 @@ class AbcSubDReader final : public AbcObjectReader {
|
||||
bool valid() const override;
|
||||
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const override;
|
||||
const char **r_err_str) const override;
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
|
||||
|
||||
void read_geometry(bke::GeometrySet &geometry_set,
|
||||
@@ -74,7 +74,7 @@ class AbcSubDReader final : public AbcObjectReader {
|
||||
int read_flag,
|
||||
const char *velocity_name,
|
||||
const float velocity_scale,
|
||||
const char **err_str) override;
|
||||
const char **r_err_str) override;
|
||||
|
||||
private:
|
||||
struct Mesh *read_mesh(struct Mesh *existing_mesh,
|
||||
@@ -82,7 +82,7 @@ class AbcSubDReader final : public AbcObjectReader {
|
||||
int read_flag,
|
||||
const char *velocity_name,
|
||||
const float velocity_scale,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
};
|
||||
|
||||
void read_mverts(Mesh &mesh,
|
||||
|
||||
@@ -62,17 +62,17 @@ bool AbcNurbsReader::valid() const
|
||||
bool AbcNurbsReader::accepts_object_type(
|
||||
const Alembic::AbcCoreAbstract::v12::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const
|
||||
const char **r_err_str) const
|
||||
{
|
||||
if (!Alembic::AbcGeom::INuPatch::matches(alembic_header)) {
|
||||
*err_str = RPT_(
|
||||
*r_err_str = RPT_(
|
||||
"Object type mismatch, Alembic object path pointed to NURBS when importing, but not any "
|
||||
"more");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ob->type != OB_CURVES_LEGACY) {
|
||||
*err_str = RPT_("Object type mismatch, Alembic object path points to NURBS");
|
||||
*r_err_str = RPT_("Object type mismatch, Alembic object path points to NURBS");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class AbcNurbsReader final : public AbcObjectReader {
|
||||
|
||||
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const override;
|
||||
const char **r_err_str) const override;
|
||||
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ void AbcObjectReader::read_geometry(bke::GeometrySet & /*geometry_set*/,
|
||||
int /*read_flag*/,
|
||||
const char * /*velocity_name*/,
|
||||
const float /*velocity_scale*/,
|
||||
const char ** /*err_str*/)
|
||||
const char ** /*r_err_str*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ class AbcObjectReader {
|
||||
virtual bool valid() const = 0;
|
||||
virtual bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const = 0;
|
||||
const char **r_err_str) const = 0;
|
||||
|
||||
virtual void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) = 0;
|
||||
|
||||
@@ -152,7 +152,7 @@ class AbcObjectReader {
|
||||
int read_flag,
|
||||
const char *velocity_name,
|
||||
float velocity_scale,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
|
||||
virtual bool topology_changed(const Mesh *existing_mesh,
|
||||
const Alembic::Abc::ISampleSelector &sample_sel);
|
||||
|
||||
@@ -41,17 +41,17 @@ bool AbcPointsReader::valid() const
|
||||
bool AbcPointsReader::accepts_object_type(
|
||||
const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const
|
||||
const char **r_err_str) const
|
||||
{
|
||||
if (!Alembic::AbcGeom::IPoints::matches(alembic_header)) {
|
||||
*err_str = RPT_(
|
||||
*r_err_str = RPT_(
|
||||
"Object type mismatch, Alembic object path pointed to Points when importing, but not any "
|
||||
"more");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ob->type != OB_POINTCLOUD) {
|
||||
*err_str = RPT_("Object type mismatch, Alembic object path points to Points.");
|
||||
*r_err_str = RPT_("Object type mismatch, Alembic object path points to Points.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ void AbcPointsReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
int /*read_flag*/,
|
||||
const char *velocity_name,
|
||||
const float velocity_scale,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
BLI_assert(geometry_set.has_pointcloud());
|
||||
|
||||
@@ -128,7 +128,7 @@ void AbcPointsReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
sample = m_schema.getValue(sample_sel);
|
||||
}
|
||||
catch (Alembic::Util::Exception &ex) {
|
||||
*err_str = RPT_("Error reading points sample; more detail on the console");
|
||||
*r_err_str = RPT_("Error reading points sample; more detail on the console");
|
||||
printf("Alembic: error reading points sample for '%s/%s' at time %f: %s\n",
|
||||
m_iobject.getFullName().c_str(),
|
||||
m_schema.getName().c_str(),
|
||||
|
||||
@@ -23,7 +23,7 @@ class AbcPointsReader final : public AbcObjectReader {
|
||||
bool valid() const override;
|
||||
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const override;
|
||||
const char **r_err_str) const override;
|
||||
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
|
||||
|
||||
@@ -32,7 +32,7 @@ class AbcPointsReader final : public AbcObjectReader {
|
||||
int read_flag,
|
||||
const char *velocity_name,
|
||||
float velocity_scale,
|
||||
const char **err_str) override;
|
||||
const char **r_err_str) override;
|
||||
};
|
||||
|
||||
} // namespace blender::io::alembic
|
||||
|
||||
@@ -40,17 +40,17 @@ bool AbcEmptyReader::valid() const
|
||||
bool AbcEmptyReader::accepts_object_type(
|
||||
const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const
|
||||
const char **r_err_str) const
|
||||
{
|
||||
if (!Alembic::AbcGeom::IXform::matches(alembic_header)) {
|
||||
*err_str = RPT_(
|
||||
*r_err_str = RPT_(
|
||||
"Object type mismatch, Alembic object path pointed to XForm when importing, but not any "
|
||||
"more");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ob->type != OB_EMPTY) {
|
||||
*err_str = RPT_("Object type mismatch, Alembic object path points to XForm");
|
||||
*r_err_str = RPT_("Object type mismatch, Alembic object path points to XForm");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class AbcEmptyReader final : public AbcObjectReader {
|
||||
bool valid() const override;
|
||||
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
|
||||
const Object *const ob,
|
||||
const char **err_str) const override;
|
||||
const char **r_err_str) const override;
|
||||
|
||||
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
|
||||
};
|
||||
|
||||
@@ -801,19 +801,19 @@ void ABC_get_transform(CacheReader *reader, float r_mat_world[4][4], double time
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
static AbcObjectReader *get_abc_reader(CacheReader *reader, Object *ob, const char **err_str)
|
||||
static AbcObjectReader *get_abc_reader(CacheReader *reader, Object *ob, const char **r_err_str)
|
||||
{
|
||||
AbcObjectReader *abc_reader = reinterpret_cast<AbcObjectReader *>(reader);
|
||||
IObject iobject = abc_reader->iobject();
|
||||
|
||||
if (!iobject.valid()) {
|
||||
*err_str = RPT_("Invalid object: verify object path");
|
||||
*r_err_str = RPT_("Invalid object: verify object path");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const ObjectHeader &header = iobject.getHeader();
|
||||
if (!abc_reader->accepts_object_type(header, ob, err_str)) {
|
||||
/* err_str is set by acceptsObjectType() */
|
||||
if (!abc_reader->accepts_object_type(header, ob, r_err_str)) {
|
||||
/* r_err_str is set by acceptsObjectType() */
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -831,9 +831,9 @@ void ABC_read_geometry(CacheReader *reader,
|
||||
Object *ob,
|
||||
blender::bke::GeometrySet &geometry_set,
|
||||
const ABCReadParams *params,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
AbcObjectReader *abc_reader = get_abc_reader(reader, ob, err_str);
|
||||
AbcObjectReader *abc_reader = get_abc_reader(reader, ob, r_err_str);
|
||||
if (abc_reader == nullptr) {
|
||||
return;
|
||||
}
|
||||
@@ -844,16 +844,16 @@ void ABC_read_geometry(CacheReader *reader,
|
||||
params->read_flags,
|
||||
params->velocity_name,
|
||||
params->velocity_scale,
|
||||
err_str);
|
||||
r_err_str);
|
||||
}
|
||||
|
||||
bool ABC_mesh_topology_changed(CacheReader *reader,
|
||||
Object *ob,
|
||||
const Mesh *existing_mesh,
|
||||
const double time,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
AbcObjectReader *abc_reader = get_abc_reader(reader, ob, err_str);
|
||||
AbcObjectReader *abc_reader = get_abc_reader(reader, ob, r_err_str);
|
||||
if (abc_reader == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -551,13 +551,13 @@ bool USD_import(const bContext *C,
|
||||
* Alembic importer code. */
|
||||
static USDPrimReader *get_usd_reader(CacheReader *reader,
|
||||
const Object * /*ob*/,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
USDPrimReader *usd_reader = reinterpret_cast<USDPrimReader *>(reader);
|
||||
pxr::UsdPrim iobject = usd_reader->prim();
|
||||
|
||||
if (!iobject.IsValid()) {
|
||||
*err_str = RPT_("Invalid object: verify object path");
|
||||
*r_err_str = RPT_("Invalid object: verify object path");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -576,24 +576,24 @@ void USD_read_geometry(CacheReader *reader,
|
||||
const Object *ob,
|
||||
blender::bke::GeometrySet &geometry_set,
|
||||
const USDMeshReadParams params,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
USDGeomReader *usd_reader = dynamic_cast<USDGeomReader *>(get_usd_reader(reader, ob, err_str));
|
||||
USDGeomReader *usd_reader = dynamic_cast<USDGeomReader *>(get_usd_reader(reader, ob, r_err_str));
|
||||
|
||||
if (usd_reader == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
return usd_reader->read_geometry(geometry_set, params, err_str);
|
||||
return usd_reader->read_geometry(geometry_set, params, r_err_str);
|
||||
}
|
||||
|
||||
bool USD_mesh_topology_changed(CacheReader *reader,
|
||||
const Object *ob,
|
||||
const Mesh *existing_mesh,
|
||||
const double time,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
USDGeomReader *usd_reader = dynamic_cast<USDGeomReader *>(get_usd_reader(reader, ob, err_str));
|
||||
USDGeomReader *usd_reader = dynamic_cast<USDGeomReader *>(get_usd_reader(reader, ob, r_err_str));
|
||||
|
||||
if (usd_reader == nullptr) {
|
||||
return false;
|
||||
|
||||
@@ -322,7 +322,7 @@ void USDCurvesReader::read_custom_data(bke::CurvesGeometry &curves,
|
||||
|
||||
void USDCurvesReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
const USDMeshReadParams params,
|
||||
const char ** /*err_str*/)
|
||||
const char ** /*r_err_str*/)
|
||||
{
|
||||
if (!curve_prim_) {
|
||||
return;
|
||||
|
||||
@@ -43,7 +43,7 @@ class USDCurvesReader : public USDGeomReader {
|
||||
|
||||
void read_geometry(bke::GeometrySet &geometry_set,
|
||||
USDMeshReadParams params,
|
||||
const char **err_str) override;
|
||||
const char **r_err_str) override;
|
||||
|
||||
void read_custom_data(bke::CurvesGeometry &curves, const double motionSampleTime) const;
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ class USDGeomReader : public USDXformReader {
|
||||
|
||||
virtual void read_geometry(bke::GeometrySet &geometry_set,
|
||||
USDMeshReadParams params,
|
||||
const char **err_str) = 0;
|
||||
const char **r_err_str) = 0;
|
||||
|
||||
virtual bool topology_changed(const Mesh * /*existing_mesh*/, double /*motionSampleTime*/)
|
||||
{
|
||||
|
||||
@@ -810,7 +810,7 @@ void USDMeshReader::readFaceSetsSample(Main *bmain, Mesh *mesh, const double mot
|
||||
|
||||
Mesh *USDMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
const USDMeshReadParams params,
|
||||
const char ** /*err_str*/)
|
||||
const char ** /*r_err_str*/)
|
||||
{
|
||||
if (!mesh_prim_) {
|
||||
return existing_mesh;
|
||||
@@ -868,10 +868,10 @@ Mesh *USDMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
|
||||
void USDMeshReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
const USDMeshReadParams params,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
Mesh *existing_mesh = geometry_set.get_mesh_for_write();
|
||||
Mesh *new_mesh = read_mesh(existing_mesh, params, err_str);
|
||||
Mesh *new_mesh = read_mesh(existing_mesh, params, r_err_str);
|
||||
|
||||
if (new_mesh != existing_mesh) {
|
||||
geometry_set.replace_mesh(new_mesh);
|
||||
|
||||
@@ -52,7 +52,7 @@ class USDMeshReader : public USDGeomReader {
|
||||
|
||||
void read_geometry(bke::GeometrySet &geometry_set,
|
||||
USDMeshReadParams params,
|
||||
const char **err_str) override;
|
||||
const char **r_err_str) override;
|
||||
|
||||
bool topology_changed(const Mesh *existing_mesh, double motionSampleTime) override;
|
||||
|
||||
@@ -87,7 +87,7 @@ class USDMeshReader : public USDGeomReader {
|
||||
|
||||
Mesh *read_mesh(struct Mesh *existing_mesh,
|
||||
const USDMeshReadParams params,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
|
||||
void read_custom_data(const ImportSettings *settings,
|
||||
Mesh *mesh,
|
||||
|
||||
@@ -168,16 +168,16 @@ void USDNurbsReader::read_curve_sample(Curve *cu, const double motionSampleTime)
|
||||
|
||||
void USDNurbsReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
const USDMeshReadParams params,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
BLI_assert(geometry_set.has_mesh());
|
||||
Mesh *new_mesh = read_mesh(nullptr, params, err_str);
|
||||
Mesh *new_mesh = read_mesh(nullptr, params, r_err_str);
|
||||
geometry_set.replace_mesh(new_mesh);
|
||||
}
|
||||
|
||||
Mesh *USDNurbsReader::read_mesh(Mesh * /*existing_mesh*/,
|
||||
const USDMeshReadParams params,
|
||||
const char ** /*err_str*/)
|
||||
const char ** /*r_err_str*/)
|
||||
{
|
||||
pxr::UsdGeomCurves curve_prim(prim_);
|
||||
|
||||
|
||||
@@ -41,10 +41,10 @@ class USDNurbsReader : public USDGeomReader {
|
||||
|
||||
void read_geometry(bke::GeometrySet &geometry_set,
|
||||
USDMeshReadParams params,
|
||||
const char **err_str) override;
|
||||
const char **r_err_str) override;
|
||||
|
||||
private:
|
||||
Mesh *read_mesh(struct Mesh *existing_mesh, USDMeshReadParams params, const char **err_str);
|
||||
Mesh *read_mesh(struct Mesh *existing_mesh, USDMeshReadParams params, const char **r_err_str);
|
||||
};
|
||||
|
||||
} // namespace blender::io::usd
|
||||
|
||||
@@ -74,7 +74,7 @@ void USDPointsReader::read_object_data(Main *bmain, double motionSampleTime)
|
||||
|
||||
void USDPointsReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
USDMeshReadParams params,
|
||||
const char ** /*err_str*/)
|
||||
const char ** /*r_err_str*/)
|
||||
{
|
||||
if (!points_prim_) {
|
||||
/* Invalid prim, so we pass. */
|
||||
|
||||
@@ -37,7 +37,7 @@ class USDPointsReader : public USDGeomReader {
|
||||
* to update animated geometry. */
|
||||
void read_geometry(bke::GeometrySet &geometry_set,
|
||||
USDMeshReadParams params,
|
||||
const char **err_str) override;
|
||||
const char **r_err_str) override;
|
||||
|
||||
void read_velocities(PointCloud *point_cloud, const double motionSampleTime) const;
|
||||
void read_custom_data(PointCloud *point_cloud, const double motionSampleTime) const;
|
||||
|
||||
@@ -133,7 +133,7 @@ bool USDShapeReader::read_mesh_values(double motionSampleTime,
|
||||
|
||||
Mesh *USDShapeReader::read_mesh(Mesh *existing_mesh,
|
||||
const USDMeshReadParams params,
|
||||
const char ** /*err_str*/)
|
||||
const char ** /*r_err_str*/)
|
||||
{
|
||||
pxr::VtIntArray face_indices;
|
||||
pxr::VtIntArray face_counts;
|
||||
@@ -169,10 +169,10 @@ Mesh *USDShapeReader::read_mesh(Mesh *existing_mesh,
|
||||
|
||||
void USDShapeReader::read_geometry(bke::GeometrySet &geometry_set,
|
||||
USDMeshReadParams params,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
Mesh *existing_mesh = geometry_set.get_mesh_for_write();
|
||||
Mesh *new_mesh = read_mesh(existing_mesh, params, err_str);
|
||||
Mesh *new_mesh = read_mesh(existing_mesh, params, r_err_str);
|
||||
|
||||
if (new_mesh != existing_mesh) {
|
||||
geometry_set.replace_mesh(new_mesh);
|
||||
|
||||
@@ -47,7 +47,7 @@ class USDShapeReader : public USDGeomReader {
|
||||
pxr::VtIntArray &face_indices,
|
||||
pxr::VtIntArray &face_counts) const;
|
||||
|
||||
Mesh *read_mesh(Mesh *existing_mesh, USDMeshReadParams params, const char ** /*err_str*/);
|
||||
Mesh *read_mesh(Mesh *existing_mesh, USDMeshReadParams params, const char ** /*r_err_str*/);
|
||||
|
||||
public:
|
||||
USDShapeReader(const pxr::UsdPrim &prim,
|
||||
@@ -58,7 +58,7 @@ class USDShapeReader : public USDGeomReader {
|
||||
void read_object_data(Main *bmain, double motionSampleTime) override;
|
||||
void read_geometry(bke::GeometrySet & /*geometry_set*/,
|
||||
USDMeshReadParams /*params*/,
|
||||
const char ** /*err_str*/) override;
|
||||
const char ** /*r_err_str*/) override;
|
||||
|
||||
/* Returns the generated mesh might be affected by time-varying attributes.
|
||||
* This assumes mesh_from_prim() has been called. */
|
||||
|
||||
@@ -270,13 +270,13 @@ void USD_read_geometry(CacheReader *reader,
|
||||
const Object *ob,
|
||||
blender::bke::GeometrySet &geometry_set,
|
||||
USDMeshReadParams params,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
|
||||
bool USD_mesh_topology_changed(CacheReader *reader,
|
||||
const Object *ob,
|
||||
const Mesh *existing_mesh,
|
||||
double time,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
|
||||
CacheReader *CacheReader_open_usd_object(CacheArchiveHandle *handle,
|
||||
CacheReader *reader,
|
||||
|
||||
@@ -226,10 +226,12 @@ void RNA_property_float_ui_range(PointerRNA *ptr,
|
||||
int RNA_property_float_clamp(PointerRNA *ptr, PropertyRNA *prop, float *value);
|
||||
int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value);
|
||||
|
||||
bool RNA_enum_identifier(const EnumPropertyItem *item, int value, const char **identifier);
|
||||
int RNA_enum_bitflag_identifiers(const EnumPropertyItem *item, int value, const char **identifier);
|
||||
bool RNA_enum_identifier(const EnumPropertyItem *item, int value, const char **r_identifier);
|
||||
int RNA_enum_bitflag_identifiers(const EnumPropertyItem *item,
|
||||
int value,
|
||||
const char **r_identifier);
|
||||
bool RNA_enum_name(const EnumPropertyItem *item, int value, const char **r_name);
|
||||
bool RNA_enum_description(const EnumPropertyItem *item, int value, const char **description);
|
||||
bool RNA_enum_description(const EnumPropertyItem *item, int value, const char **r_description);
|
||||
int RNA_enum_from_value(const EnumPropertyItem *item, int value);
|
||||
int RNA_enum_from_identifier(const EnumPropertyItem *item, const char *identifier);
|
||||
bool RNA_enum_value_from_identifier(const EnumPropertyItem *item,
|
||||
@@ -741,8 +743,8 @@ void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter);
|
||||
void RNA_parameter_list_next(ParameterIterator *iter);
|
||||
void RNA_parameter_list_end(ParameterIterator *iter);
|
||||
|
||||
void RNA_parameter_get(ParameterList *parms, PropertyRNA *parm, void **value);
|
||||
void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void **value);
|
||||
void RNA_parameter_get(ParameterList *parms, PropertyRNA *parm, void **r_value);
|
||||
void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void **r_value);
|
||||
void RNA_parameter_set(ParameterList *parms, PropertyRNA *parm, const void *value);
|
||||
void RNA_parameter_set_lookup(ParameterList *parms, const char *identifier, const void *value);
|
||||
|
||||
|
||||
@@ -6404,7 +6404,7 @@ void RNA_parameter_list_end(ParameterIterator * /*iter*/)
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
void RNA_parameter_get(ParameterList *parms, PropertyRNA *parm, void **value)
|
||||
void RNA_parameter_get(ParameterList *parms, PropertyRNA *parm, void **r_value)
|
||||
{
|
||||
ParameterIterator iter;
|
||||
|
||||
@@ -6420,20 +6420,20 @@ void RNA_parameter_get(ParameterList *parms, PropertyRNA *parm, void **value)
|
||||
if (parm->flag & PROP_DYNAMIC) {
|
||||
/* for dynamic arrays and strings, data is a pointer to an array */
|
||||
ParameterDynAlloc *data_alloc = static_cast<ParameterDynAlloc *>(iter.data);
|
||||
*value = data_alloc->array;
|
||||
*r_value = data_alloc->array;
|
||||
}
|
||||
else {
|
||||
*value = iter.data;
|
||||
*r_value = iter.data;
|
||||
}
|
||||
}
|
||||
else {
|
||||
*value = nullptr;
|
||||
*r_value = nullptr;
|
||||
}
|
||||
|
||||
RNA_parameter_list_end(&iter);
|
||||
}
|
||||
|
||||
void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void **value)
|
||||
void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void **r_value)
|
||||
{
|
||||
PropertyRNA *parm;
|
||||
|
||||
@@ -6445,7 +6445,7 @@ void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void
|
||||
}
|
||||
|
||||
if (parm) {
|
||||
RNA_parameter_get(parms, parm, value);
|
||||
RNA_parameter_get(parms, parm, r_value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ struct MDDHead {
|
||||
static bool meshcache_read_mdd_head(FILE *fp,
|
||||
const int verts_tot,
|
||||
MDDHead *mdd_head,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
if (!fread(mdd_head, sizeof(*mdd_head), 1, fp)) {
|
||||
*err_str = RPT_("Missing header");
|
||||
*r_err_str = RPT_("Missing header");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,12 +48,12 @@ static bool meshcache_read_mdd_head(FILE *fp,
|
||||
#endif
|
||||
|
||||
if (mdd_head->verts_tot != verts_tot) {
|
||||
*err_str = RPT_("Vertex count mismatch");
|
||||
*r_err_str = RPT_("Vertex count mismatch");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mdd_head->frame_tot <= 0) {
|
||||
*err_str = RPT_("Invalid frame total");
|
||||
*r_err_str = RPT_("Invalid frame total");
|
||||
return false;
|
||||
}
|
||||
/* Intentionally don't seek back. */
|
||||
@@ -70,13 +70,13 @@ static bool meshcache_read_mdd_range(FILE *fp,
|
||||
const char interp,
|
||||
int r_index_range[2],
|
||||
float *r_factor,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
MDDHead mdd_head;
|
||||
|
||||
/* first check interpolation and get the vert locations */
|
||||
|
||||
if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, err_str) == false) {
|
||||
if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, r_err_str) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -90,14 +90,14 @@ static bool meshcache_read_mdd_range_from_time(FILE *fp,
|
||||
const float time,
|
||||
const float /*fps*/,
|
||||
float *r_frame,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
MDDHead mdd_head;
|
||||
int i;
|
||||
float f_time, f_time_prev = FLT_MAX;
|
||||
float frame;
|
||||
|
||||
if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, err_str) == false) {
|
||||
if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, r_err_str) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ static bool meshcache_read_mdd_range_from_time(FILE *fp,
|
||||
}
|
||||
|
||||
if (frames_num_read != frames_num_expect) {
|
||||
*err_str = errno ? strerror(errno) : RPT_("Timestamp read failed");
|
||||
*r_err_str = errno ? strerror(errno) : RPT_("Timestamp read failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -144,21 +144,21 @@ bool MOD_meshcache_read_mdd_index(FILE *fp,
|
||||
const int verts_tot,
|
||||
const int index,
|
||||
const float factor,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
MDDHead mdd_head;
|
||||
|
||||
if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, err_str) == false) {
|
||||
if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, r_err_str) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (BLI_fseek(fp, mdd_head.frame_tot * sizeof(int), SEEK_CUR) != 0) {
|
||||
*err_str = RPT_("Header seek failed");
|
||||
*r_err_str = RPT_("Header seek failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (BLI_fseek(fp, sizeof(float[3]) * index * mdd_head.verts_tot, SEEK_CUR) != 0) {
|
||||
*err_str = RPT_("Failed to seek frame");
|
||||
*r_err_str = RPT_("Failed to seek frame");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ bool MOD_meshcache_read_mdd_index(FILE *fp,
|
||||
#else
|
||||
/* no blending */
|
||||
if (!fread(vertexCos, sizeof(float[3]), mdd_head.verts_tot, f)) {
|
||||
*err_str = errno ? strerror(errno) : RPT_("Failed to read frame");
|
||||
*r_err_str = errno ? strerror(errno) : RPT_("Failed to read frame");
|
||||
return false;
|
||||
}
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
@@ -209,7 +209,7 @@ bool MOD_meshcache_read_mdd_index(FILE *fp,
|
||||
}
|
||||
|
||||
if (verts_read_num != mdd_head.verts_tot) {
|
||||
*err_str = errno ? strerror(errno) : RPT_("Vertex coordinate read failed");
|
||||
*r_err_str = errno ? strerror(errno) : RPT_("Vertex coordinate read failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ bool MOD_meshcache_read_mdd_frame(FILE *fp,
|
||||
const int verts_tot,
|
||||
const char interp,
|
||||
const float frame,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
int index_range[2];
|
||||
float factor;
|
||||
@@ -232,7 +232,7 @@ bool MOD_meshcache_read_mdd_frame(FILE *fp,
|
||||
interp,
|
||||
index_range,
|
||||
&factor, /* read into these values */
|
||||
err_str) == false)
|
||||
r_err_str) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ bool MOD_meshcache_read_mdd_frame(FILE *fp,
|
||||
if (index_range[0] == index_range[1]) {
|
||||
/* read single */
|
||||
if ((BLI_fseek(fp, 0, SEEK_SET) == 0) &&
|
||||
MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str))
|
||||
MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, r_err_str))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -250,9 +250,9 @@ bool MOD_meshcache_read_mdd_frame(FILE *fp,
|
||||
|
||||
/* read both and interpolate */
|
||||
if ((BLI_fseek(fp, 0, SEEK_SET) == 0) &&
|
||||
MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str) &&
|
||||
MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, r_err_str) &&
|
||||
(BLI_fseek(fp, 0, SEEK_SET) == 0) &&
|
||||
MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[1], factor, err_str))
|
||||
MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[1], factor, r_err_str))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ bool MOD_meshcache_read_mdd_times(const char *filepath,
|
||||
const float time,
|
||||
const float fps,
|
||||
const char time_mode,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
float frame;
|
||||
|
||||
@@ -275,7 +275,7 @@ bool MOD_meshcache_read_mdd_times(const char *filepath,
|
||||
bool ok;
|
||||
|
||||
if (fp == nullptr) {
|
||||
*err_str = errno ? strerror(errno) : RPT_("Unknown error opening file");
|
||||
*r_err_str = errno ? strerror(errno) : RPT_("Unknown error opening file");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -286,7 +286,8 @@ bool MOD_meshcache_read_mdd_times(const char *filepath,
|
||||
}
|
||||
case MOD_MESHCACHE_TIME_SECONDS: {
|
||||
/* we need to find the closest time */
|
||||
if (meshcache_read_mdd_range_from_time(fp, verts_tot, time, fps, &frame, err_str) == false) {
|
||||
if (meshcache_read_mdd_range_from_time(fp, verts_tot, time, fps, &frame, r_err_str) == false)
|
||||
{
|
||||
fclose(fp);
|
||||
return false;
|
||||
}
|
||||
@@ -296,7 +297,7 @@ bool MOD_meshcache_read_mdd_times(const char *filepath,
|
||||
case MOD_MESHCACHE_TIME_FACTOR:
|
||||
default: {
|
||||
MDDHead mdd_head;
|
||||
if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, err_str) == false) {
|
||||
if (meshcache_read_mdd_head(fp, verts_tot, &mdd_head, r_err_str) == false) {
|
||||
fclose(fp);
|
||||
return false;
|
||||
}
|
||||
@@ -307,7 +308,7 @@ bool MOD_meshcache_read_mdd_times(const char *filepath,
|
||||
}
|
||||
}
|
||||
|
||||
ok = MOD_meshcache_read_mdd_frame(fp, vertexCos, verts_tot, interp, frame, err_str);
|
||||
ok = MOD_meshcache_read_mdd_frame(fp, vertexCos, verts_tot, interp, frame, r_err_str);
|
||||
|
||||
fclose(fp);
|
||||
return ok;
|
||||
|
||||
@@ -40,15 +40,15 @@ struct PC2Head {
|
||||
static bool meshcache_read_pc2_head(FILE *fp,
|
||||
const int verts_tot,
|
||||
PC2Head *pc2_head,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
if (!fread(pc2_head, sizeof(*pc2_head), 1, fp)) {
|
||||
*err_str = RPT_("Missing header");
|
||||
*r_err_str = RPT_("Missing header");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!STREQ(pc2_head->header, "POINTCACHE2")) {
|
||||
*err_str = RPT_("Invalid header");
|
||||
*r_err_str = RPT_("Invalid header");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -58,12 +58,12 @@ static bool meshcache_read_pc2_head(FILE *fp,
|
||||
#endif
|
||||
|
||||
if (pc2_head->verts_tot != verts_tot) {
|
||||
*err_str = RPT_("Vertex count mismatch");
|
||||
*r_err_str = RPT_("Vertex count mismatch");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pc2_head->frame_tot <= 0) {
|
||||
*err_str = RPT_("Invalid frame total");
|
||||
*r_err_str = RPT_("Invalid frame total");
|
||||
return false;
|
||||
}
|
||||
/* Intentionally don't seek back. */
|
||||
@@ -82,13 +82,13 @@ static bool meshcache_read_pc2_range(FILE *fp,
|
||||
const char interp,
|
||||
int r_index_range[2],
|
||||
float *r_factor,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
PC2Head pc2_head;
|
||||
|
||||
/* first check interpolation and get the vert locations */
|
||||
|
||||
if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, err_str) == false) {
|
||||
if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, r_err_str) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -102,12 +102,12 @@ static bool meshcache_read_pc2_range_from_time(FILE *fp,
|
||||
const float time,
|
||||
const float fps,
|
||||
float *r_frame,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
PC2Head pc2_head;
|
||||
float frame;
|
||||
|
||||
if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, err_str) == false) {
|
||||
if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, r_err_str) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -129,16 +129,16 @@ bool MOD_meshcache_read_pc2_index(FILE *fp,
|
||||
const int verts_tot,
|
||||
const int index,
|
||||
const float factor,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
PC2Head pc2_head;
|
||||
|
||||
if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, err_str) == false) {
|
||||
if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, r_err_str) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (BLI_fseek(fp, sizeof(float[3]) * index * pc2_head.verts_tot, SEEK_CUR) != 0) {
|
||||
*err_str = RPT_("Failed to seek frame");
|
||||
*r_err_str = RPT_("Failed to seek frame");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ bool MOD_meshcache_read_pc2_index(FILE *fp,
|
||||
}
|
||||
|
||||
if (verts_read_num != pc2_head.verts_tot) {
|
||||
*err_str = errno ? strerror(errno) : RPT_("Vertex coordinate read failed");
|
||||
*r_err_str = errno ? strerror(errno) : RPT_("Vertex coordinate read failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ bool MOD_meshcache_read_pc2_frame(FILE *fp,
|
||||
const int verts_tot,
|
||||
const char interp,
|
||||
const float frame,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
int index_range[2];
|
||||
float factor;
|
||||
@@ -201,7 +201,7 @@ bool MOD_meshcache_read_pc2_frame(FILE *fp,
|
||||
interp,
|
||||
index_range,
|
||||
&factor, /* read into these values */
|
||||
err_str) == false)
|
||||
r_err_str) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -209,7 +209,7 @@ bool MOD_meshcache_read_pc2_frame(FILE *fp,
|
||||
if (index_range[0] == index_range[1]) {
|
||||
/* read single */
|
||||
if ((BLI_fseek(fp, 0, SEEK_SET) == 0) &&
|
||||
MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str))
|
||||
MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, r_err_str))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -219,9 +219,9 @@ bool MOD_meshcache_read_pc2_frame(FILE *fp,
|
||||
|
||||
/* read both and interpolate */
|
||||
if ((BLI_fseek(fp, 0, SEEK_SET) == 0) &&
|
||||
MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str) &&
|
||||
MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, r_err_str) &&
|
||||
(BLI_fseek(fp, 0, SEEK_SET) == 0) &&
|
||||
MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[1], factor, err_str))
|
||||
MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[1], factor, r_err_str))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -236,7 +236,7 @@ bool MOD_meshcache_read_pc2_times(const char *filepath,
|
||||
const float time,
|
||||
const float fps,
|
||||
const char time_mode,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
float frame;
|
||||
|
||||
@@ -244,7 +244,7 @@ bool MOD_meshcache_read_pc2_times(const char *filepath,
|
||||
bool ok;
|
||||
|
||||
if (fp == nullptr) {
|
||||
*err_str = errno ? strerror(errno) : RPT_("Unknown error opening file");
|
||||
*r_err_str = errno ? strerror(errno) : RPT_("Unknown error opening file");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -255,7 +255,8 @@ bool MOD_meshcache_read_pc2_times(const char *filepath,
|
||||
}
|
||||
case MOD_MESHCACHE_TIME_SECONDS: {
|
||||
/* we need to find the closest time */
|
||||
if (meshcache_read_pc2_range_from_time(fp, verts_tot, time, fps, &frame, err_str) == false) {
|
||||
if (meshcache_read_pc2_range_from_time(fp, verts_tot, time, fps, &frame, r_err_str) == false)
|
||||
{
|
||||
fclose(fp);
|
||||
return false;
|
||||
}
|
||||
@@ -265,7 +266,7 @@ bool MOD_meshcache_read_pc2_times(const char *filepath,
|
||||
case MOD_MESHCACHE_TIME_FACTOR:
|
||||
default: {
|
||||
PC2Head pc2_head;
|
||||
if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, err_str) == false) {
|
||||
if (meshcache_read_pc2_head(fp, verts_tot, &pc2_head, r_err_str) == false) {
|
||||
fclose(fp);
|
||||
return false;
|
||||
}
|
||||
@@ -276,7 +277,7 @@ bool MOD_meshcache_read_pc2_times(const char *filepath,
|
||||
}
|
||||
}
|
||||
|
||||
ok = MOD_meshcache_read_pc2_frame(fp, vertexCos, verts_tot, interp, frame, err_str);
|
||||
ok = MOD_meshcache_read_pc2_frame(fp, vertexCos, verts_tot, interp, frame, r_err_str);
|
||||
|
||||
fclose(fp);
|
||||
return ok;
|
||||
|
||||
@@ -10,14 +10,18 @@
|
||||
|
||||
/* `MOD_meshcache_mdd.cc` */
|
||||
|
||||
bool MOD_meshcache_read_mdd_index(
|
||||
FILE *fp, float (*vertexCos)[3], int verts_tot, int index, float factor, const char **err_str);
|
||||
bool MOD_meshcache_read_mdd_index(FILE *fp,
|
||||
float (*vertexCos)[3],
|
||||
int verts_tot,
|
||||
int index,
|
||||
float factor,
|
||||
const char **r_err_str);
|
||||
bool MOD_meshcache_read_mdd_frame(FILE *fp,
|
||||
float (*vertexCos)[3],
|
||||
int verts_tot,
|
||||
char interp,
|
||||
float frame,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
bool MOD_meshcache_read_mdd_times(const char *filepath,
|
||||
float (*vertexCos)[3],
|
||||
int verts_tot,
|
||||
@@ -25,18 +29,22 @@ bool MOD_meshcache_read_mdd_times(const char *filepath,
|
||||
float time,
|
||||
float fps,
|
||||
char time_mode,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
|
||||
/* `MOD_meshcache_pc2.cc` */
|
||||
|
||||
bool MOD_meshcache_read_pc2_index(
|
||||
FILE *fp, float (*vertexCos)[3], int verts_tot, int index, float factor, const char **err_str);
|
||||
bool MOD_meshcache_read_pc2_index(FILE *fp,
|
||||
float (*vertexCos)[3],
|
||||
int verts_tot,
|
||||
int index,
|
||||
float factor,
|
||||
const char **r_err_str);
|
||||
bool MOD_meshcache_read_pc2_frame(FILE *fp,
|
||||
float (*vertexCos)[3],
|
||||
int verts_tot,
|
||||
char interp,
|
||||
float frame,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
bool MOD_meshcache_read_pc2_times(const char *filepath,
|
||||
float (*vertexCos)[3],
|
||||
int verts_tot,
|
||||
@@ -44,7 +52,7 @@ bool MOD_meshcache_read_pc2_times(const char *filepath,
|
||||
float time,
|
||||
float fps,
|
||||
char time_mode,
|
||||
const char **err_str);
|
||||
const char **r_err_str);
|
||||
|
||||
/* `MOD_meshcache_util.cc` */
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ static bool can_use_mesh_for_orco_evaluation(MeshSeqCacheModifierData *mcmd,
|
||||
const ModifierEvalContext *ctx,
|
||||
const Mesh *mesh,
|
||||
const float time,
|
||||
const char **err_str)
|
||||
const char **r_err_str)
|
||||
{
|
||||
if ((ctx->flag & MOD_APPLY_ORCO) == 0) {
|
||||
return false;
|
||||
@@ -123,7 +123,7 @@ static bool can_use_mesh_for_orco_evaluation(MeshSeqCacheModifierData *mcmd,
|
||||
switch (cache_file->type) {
|
||||
case CACHEFILE_TYPE_ALEMBIC:
|
||||
# ifdef WITH_ALEMBIC
|
||||
if (!ABC_mesh_topology_changed(mcmd->reader, ctx->object, mesh, time, err_str)) {
|
||||
if (!ABC_mesh_topology_changed(mcmd->reader, ctx->object, mesh, time, r_err_str)) {
|
||||
return true;
|
||||
}
|
||||
# endif
|
||||
@@ -131,7 +131,7 @@ static bool can_use_mesh_for_orco_evaluation(MeshSeqCacheModifierData *mcmd,
|
||||
case CACHEFILE_TYPE_USD:
|
||||
# ifdef WITH_USD
|
||||
if (!blender::io::usd::USD_mesh_topology_changed(
|
||||
mcmd->reader, ctx->object, mesh, time, err_str))
|
||||
mcmd->reader, ctx->object, mesh, time, r_err_str))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -121,16 +121,16 @@ int node_group_ui_class(const bNode *node)
|
||||
|
||||
bool node_group_poll_instance(const bNode *node,
|
||||
const bNodeTree *nodetree,
|
||||
const char **disabled_hint)
|
||||
const char **r_disabled_hint)
|
||||
{
|
||||
if (!node->typeinfo->poll(node->typeinfo, nodetree, disabled_hint)) {
|
||||
if (!node->typeinfo->poll(node->typeinfo, nodetree, r_disabled_hint)) {
|
||||
return false;
|
||||
}
|
||||
const bNodeTree *grouptree = reinterpret_cast<const bNodeTree *>(node->id);
|
||||
if (!grouptree) {
|
||||
return true;
|
||||
}
|
||||
return blender::bke::node_group_poll(nodetree, grouptree, disabled_hint);
|
||||
return blender::bke::node_group_poll(nodetree, grouptree, r_disabled_hint);
|
||||
}
|
||||
|
||||
std::string node_group_ui_description(const bNode &node)
|
||||
|
||||
@@ -16,7 +16,7 @@ struct Sequence;
|
||||
bool SEQ_edit_sequence_swap(Scene *scene,
|
||||
Sequence *seq_a,
|
||||
Sequence *seq_b,
|
||||
const char **error_str);
|
||||
const char **r_error_str);
|
||||
/**
|
||||
* Move sequence to seqbase.
|
||||
*
|
||||
@@ -35,13 +35,12 @@ bool SEQ_edit_move_strip_to_seqbase(Scene *scene,
|
||||
* \param scene: Scene containing the editing
|
||||
* \param src_seq: Sequence to move
|
||||
* \param dst_seqm: Target Meta sequence
|
||||
* \param error_str: Error message
|
||||
* \param r_error_str: Error message
|
||||
*/
|
||||
bool SEQ_edit_move_strip_to_meta(Scene *scene,
|
||||
Sequence *src_seq,
|
||||
Sequence *dst_seqm,
|
||||
const char **error_str);
|
||||
bool SEQ_meta_separate(Scene *scene, Sequence *src_meta, const char **error_str);
|
||||
const char **r_error_str);
|
||||
/**
|
||||
* Flag seq and its users (effects) for removal.
|
||||
*/
|
||||
|
||||
@@ -39,31 +39,34 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
bool SEQ_edit_sequence_swap(Scene *scene, Sequence *seq_a, Sequence *seq_b, const char **error_str)
|
||||
bool SEQ_edit_sequence_swap(Scene *scene,
|
||||
Sequence *seq_a,
|
||||
Sequence *seq_b,
|
||||
const char **r_error_str)
|
||||
{
|
||||
char name[sizeof(seq_a->name)];
|
||||
|
||||
if (SEQ_time_strip_length_get(scene, seq_a) != SEQ_time_strip_length_get(scene, seq_b)) {
|
||||
*error_str = N_("Strips must be the same length");
|
||||
*r_error_str = N_("Strips must be the same length");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* type checking, could be more advanced but disallow sound vs non-sound copy */
|
||||
if (seq_a->type != seq_b->type) {
|
||||
if (seq_a->type == SEQ_TYPE_SOUND_RAM || seq_b->type == SEQ_TYPE_SOUND_RAM) {
|
||||
*error_str = N_("Strips were not compatible");
|
||||
*r_error_str = N_("Strips were not compatible");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* disallow effects to swap with non-effects strips */
|
||||
if ((seq_a->type & SEQ_TYPE_EFFECT) != (seq_b->type & SEQ_TYPE_EFFECT)) {
|
||||
*error_str = N_("Strips were not compatible");
|
||||
*r_error_str = N_("Strips were not compatible");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((seq_a->type & SEQ_TYPE_EFFECT) && (seq_b->type & SEQ_TYPE_EFFECT)) {
|
||||
if (SEQ_effect_get_num_inputs(seq_a->type) != SEQ_effect_get_num_inputs(seq_b->type)) {
|
||||
*error_str = N_("Strips must have the same number of inputs");
|
||||
*r_error_str = N_("Strips must have the same number of inputs");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -211,34 +214,34 @@ bool SEQ_edit_move_strip_to_seqbase(Scene *scene,
|
||||
bool SEQ_edit_move_strip_to_meta(Scene *scene,
|
||||
Sequence *src_seq,
|
||||
Sequence *dst_seqm,
|
||||
const char **error_str)
|
||||
const char **r_error_str)
|
||||
{
|
||||
/* Find the appropriate seqbase */
|
||||
Editing *ed = SEQ_editing_get(scene);
|
||||
ListBase *seqbase = SEQ_get_seqbase_by_seq(scene, src_seq);
|
||||
|
||||
if (dst_seqm->type != SEQ_TYPE_META) {
|
||||
*error_str = N_("Cannot move strip to non-meta strip");
|
||||
*r_error_str = N_("Cannot move strip to non-meta strip");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (src_seq == dst_seqm) {
|
||||
*error_str = N_("Strip cannot be moved into itself");
|
||||
*r_error_str = N_("Strip cannot be moved into itself");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (seqbase == &dst_seqm->seqbase) {
|
||||
*error_str = N_("Moved strip is already inside provided meta strip");
|
||||
*r_error_str = N_("Moved strip is already inside provided meta strip");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (src_seq->type == SEQ_TYPE_META && SEQ_exists_in_seqbase(dst_seqm, &src_seq->seqbase)) {
|
||||
*error_str = N_("Moved strip is parent of provided meta strip");
|
||||
*r_error_str = N_("Moved strip is parent of provided meta strip");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!SEQ_exists_in_seqbase(dst_seqm, &ed->seqbase)) {
|
||||
*error_str = N_("Cannot move strip to different scene");
|
||||
*r_error_str = N_("Cannot move strip to different scene");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user