Refactor: in USD importer extract read_mesh params into a struct #104459
|
@ -465,7 +465,7 @@ static USDPrimReader *get_usd_reader(CacheReader *reader,
|
|||
return usd_reader;
|
||||
}
|
||||
|
||||
USDMeshReadParams create_mesh_read_params(double motion_sample_time, int read_flags)
|
||||
USDMeshReadParams create_mesh_read_params(const double motion_sample_time, const int read_flags)
|
||||
SonnyCampbell_Unity marked this conversation as resolved
|
||||
{
|
||||
USDMeshReadParams params = {};
|
||||
params.motion_sample_time = motion_sample_time;
|
||||
|
@ -476,7 +476,7 @@ USDMeshReadParams create_mesh_read_params(double motion_sample_time, int read_fl
|
|||
struct Mesh *USD_read_mesh(struct CacheReader *reader,
|
||||
struct Object *ob,
|
||||
struct Mesh *existing_mesh,
|
||||
USDMeshReadParams params,
|
||||
const USDMeshReadParams params,
|
||||
SonnyCampbell_Unity marked this conversation as resolved
Sybren A. Stüvel
commented
`const`
|
||||
const char **err_str)
|
||||
{
|
||||
USDGeomReader *usd_reader = dynamic_cast<USDGeomReader *>(get_usd_reader(reader, ob, err_str));
|
||||
|
|
|
@ -162,7 +162,7 @@ void USDCurvesReader::read_curve_sample(Curve *cu, const double motionSampleTime
|
|||
}
|
||||
|
||||
Mesh *USDCurvesReader::read_mesh(struct Mesh *existing_mesh,
|
||||
USDMeshReadParams params,
|
||||
const USDMeshReadParams params,
|
||||
const char ** /* err_str */)
|
||||
{
|
||||
if (!curve_prim_) {
|
||||
|
|
|
@ -818,7 +818,7 @@ void USDMeshReader::readFaceSetsSample(Main *bmain, Mesh *mesh, const double mot
|
|||
}
|
||||
|
||||
Mesh *USDMeshReader::read_mesh(Mesh *existing_mesh,
|
||||
USDMeshReadParams params,
|
||||
const USDMeshReadParams params,
|
||||
const char ** /* err_str */)
|
||||
{
|
||||
if (!mesh_prim_) {
|
||||
|
|
|
@ -165,7 +165,7 @@ void USDNurbsReader::read_curve_sample(Curve *cu, const double motionSampleTime)
|
|||
}
|
||||
|
||||
Mesh *USDNurbsReader::read_mesh(struct Mesh * /* existing_mesh */,
|
||||
USDMeshReadParams params,
|
||||
const USDMeshReadParams params,
|
||||
const char ** /* err_str */)
|
||||
{
|
||||
pxr::UsdGeomCurves curve_prim_(prim_);
|
||||
|
|
|
@ -70,7 +70,7 @@ struct USDImportParams {
|
|||
* usd file for the mesh sequence cache.
|
||||
*/
|
||||
typedef struct USDMeshReadParams {
|
||||
double motion_sample_time; /* Read USD TimeCode in frames. */
|
||||
double motion_sample_time; /* USD TimeCode in frames. */
|
||||
SonnyCampbell_Unity marked this conversation as resolved
Sybren A. Stüvel
commented
"Read" is ambiguous here. Is it past or future tense? "Read" is ambiguous here. Is it past or future tense?
Sonny Campbell
commented
It's neither. It's read as opposed to write. It's usage is everywhere as a parameter in a It's neither. It's read as opposed to write. It's usage is everywhere as a parameter in a `read_mesh` function, so it's very clear what it means from the context.
Sonny Campbell
commented
It's also consistent with It's also consistent with `ABCReadParams` for `ABC_read_mesh` in the alembic import code
Sybren A. Stüvel
commented
In that case I would just change the comment to "USD TimeCode in frames", as it then limits itself to just describing the units of measurement, and not the operation that it's involved with. The fact that it's used for reading is clear from the name of the struct. In that case I would just change the comment to "USD TimeCode in frames", as it then limits itself to just describing the units of measurement, and not the operation that it's involved with. The fact that it's used for reading is clear from the name of the struct.
Sonny Campbell
commented
Done Done
|
||||
int read_flags; /* MOD_MESHSEQ_xxx value that is set from MeshSeqCacheModifierData.read_flag. */
|
||||
} USDMeshReadParams;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
const
for both parameters.