Skip to content

Commit

Permalink
Apply formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
noreply@unity3d.com authored and thomas-tu committed Jan 11, 2023
1 parent 399e8e1 commit 9199246
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
4 changes: 1 addition & 3 deletions Source/abci/Importer/AlembicImporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ struct aiPolyMeshData
abcV4 *rgba = nullptr;
abcV4 *rgb = nullptr;
abcV2 **v2fParams = nullptr;
// FixedString128* v2fParamNames = nullptr;
// FixedString128* v2fParamNames = nullptr;
int *indices = nullptr;

int vertex_count = 0;
Expand Down Expand Up @@ -350,5 +350,3 @@ abciAPI void aiPointsFillData(aiPointsSample* sample, aiPointsData *d
abciAPI const char* aiPropertyGetName(aiProperty* prop);
abciAPI aiPropertyType aiPropertyGetType(aiProperty* prop);
abciAPI void aiPropertyCopyData(aiProperty* prop, const abcSampleSelector *ss, aiPropertyData *dst);


2 changes: 1 addition & 1 deletion Source/abci/Importer/aiMeshSchema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "aiMeshSchema.h"
#include "aiSubD.h"

constexpr size_t FixedString128::MaxLength;
constexpr size_t FixedString128::MaxLength;

aiMeshTopology::aiMeshTopology()
{
Expand Down
23 changes: 11 additions & 12 deletions Source/abci/Importer/aiMeshSchema.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class aiMeshTopology
RawVector<int> m_remap_rgba;
RawVector<int> m_remap_rgb;

std::vector<RawVector<int>> m_remap_m_IV2fGeomParam;
std::vector<RawVector<int> > m_remap_m_IV2fGeomParam;

int m_vertex_count = 0;
int m_index_count = 0; // triangulated
Expand Down Expand Up @@ -110,7 +110,7 @@ class aiMeshSample : public aiSample

std::vector<AbcGeom::IV2fGeomParam::Sample> m_IV2fGeomParam_sp;
std::vector<FixedString128> m_IV2fGeomParamName;
std::vector<RawVector<abcV2> >m_IV2fGeomParam;
std::vector<RawVector<abcV2> > m_IV2fGeomParam;

IArray<abcV3> m_points_ref;
IArray<abcV3> m_velocities_ref;
Expand Down Expand Up @@ -579,24 +579,23 @@ void aiMeshSchema<T, U>::readSampleBody(U& sample, uint64_t idx)
}
}

if (sample.m_IV2fGeomParam_sp.size() !=m_IV2fGeomParam.size() )
if (sample.m_IV2fGeomParam_sp.size() != m_IV2fGeomParam.size())
{
sample.m_IV2fGeomParam_sp = std::vector<AbcGeom::IV2fGeomParam::Sample>(m_IV2fGeomParam.size());
}

if (sample.m_IV2fGeomParamName.size() !=m_IV2fGeomParam.size() )
if (sample.m_IV2fGeomParamName.size() != m_IV2fGeomParam.size())
{
sample.m_IV2fGeomParamName = std::vector<FixedString128>(m_IV2fGeomParam.size());
}

for (int i=0;i<m_IV2fGeomParam.size();++i)
for (int i = 0; i < m_IV2fGeomParam.size(); ++i)
{
auto param = m_IV2fGeomParam[i];
// sample.m_IV2fGeomParamName[i]. = param.getName();
// sample.m_IV2fGeomParamName[i]. = param.getName();
strncpy(sample.m_IV2fGeomParamName[i].String, param.getName().c_str(), std::min(FixedString128::MaxLength, param.getName().size()));
param.getIndexed(sample.m_IV2fGeomParam_sp[i], ss);
/// deal with interpolation

}

auto bounds_param = this->m_schema.getSelfBoundsProperty();
Expand Down Expand Up @@ -1029,15 +1028,15 @@ void aiMeshSchema<T, U>::onTopologyChange(U& sample)
/// Arbitrary V2f attributes
if (sample.m_IV2fGeomParam.size() != sample.m_IV2fGeomParam_sp.size())
{
sample.m_IV2fGeomParam = std::vector<RawVector<abcV2>>(sample.m_IV2fGeomParam_sp.size());
sample.m_IV2fGeomParam = std::vector<RawVector<abcV2> >(sample.m_IV2fGeomParam_sp.size());
}

if (topology.m_remap_m_IV2fGeomParam.size() != sample.m_IV2fGeomParam_sp.size())
{
topology.m_remap_m_IV2fGeomParam = std::vector<RawVector<int>>(sample.m_IV2fGeomParam_sp.size());
topology.m_remap_m_IV2fGeomParam = std::vector<RawVector<int> >(sample.m_IV2fGeomParam_sp.size());
}

for (int i=0;i<sample.m_IV2fGeomParam_sp.size(); ++i)
for (int i = 0; i < sample.m_IV2fGeomParam_sp.size(); ++i)
{
auto sp = sample.m_IV2fGeomParam_sp[i];
if (sp.valid())
Expand All @@ -1047,7 +1046,7 @@ void aiMeshSchema<T, U>::onTopologyChange(U& sample)

if (sp.isIndexed() && sp.getIndices()->size() == refiner.indices.size())
{
IArray<int> indices{(int *) sp.getIndices()->get(), sp.getIndices()->size()};
IArray<int> indices{(int *)sp.getIndices()->get(), sp.getIndices()->size()};
refiner.template addIndexedAttribute<abcV2>(src, indices, dst, topology.m_remap_m_IV2fGeomParam[i]);
}
else if (src.size() == refiner.indices.size())
Expand Down Expand Up @@ -1316,4 +1315,4 @@ template<typename T>
char* aiMeshSample<T>::readPropertyName(int idx)
{
return &(m_IV2fGeomParamName[idx].String[0]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ unsafe struct aiPolyMeshData
public void* rgba;
public void* rgb;
public void* v2fProps;
// public void* v2fPropsNames;
// public void* v2fPropsNames;

public IntPtr indices;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public override unsafe void AbcSyncDataBegin()

vertexData.v2fProps = v2fs.GetUnsafePtr();
}
// vertexData.v2fPropsNames = split.v2fParamsNames.GetUnsafePtr();
// vertexData.v2fPropsNames = split.v2fParamsNames.GetUnsafePtr();
}

m_splitData[spi] = vertexData;
Expand Down Expand Up @@ -455,8 +455,8 @@ public override void AbcSyncDataEnd()
split.mesh.SetTangents(split.tangents);
if (split.uv0.Length > 0)
split.mesh.SetUVs(0, split.uv0);
/* if (split.uv1.Length > 0)
split.mesh.SetUVs(1, split.uv1);*/
/* if (split.uv1.Length > 0)
split.mesh.SetUVs(1, split.uv1);*/
if (split.velocities.Length > 0)
{
m_PostProcessJobs[s].Complete();
Expand All @@ -473,7 +473,7 @@ public override void AbcSyncDataEnd()
{
var customData = split.host.GetOrAddComponent<AlembicCustomData>();
customData.ClearCustomAttributes();
for (var i=0;i<split.v2fParams.Length;++i)
for (var i = 0; i < split.v2fParams.Length; ++i)
{
var name = m_abcSchema.sample.PolyMeshReadPropertyName(i);
var d = split.v2fParams[i];
Expand Down

0 comments on commit 9199246

Please sign in to comment.