forked from blender/blender
Move to use blender::Map container instead std::unordered_map #47
@ -218,7 +218,6 @@ void BlenderSceneDelegate::clear()
|
|||||||
it->remove();
|
it->remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
BogdanNagirniak marked this conversation as resolved
Outdated
|
|||||||
|
|
||||||
objects_.clear();
|
objects_.clear();
|
||||||
instancers_.clear();
|
instancers_.clear();
|
||||||
materials_.clear_and_shrink();
|
materials_.clear_and_shrink();
|
||||||
@ -567,7 +566,6 @@ void BlenderSceneDelegate::remove_unused_objects()
|
|||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/* Remove unused materials */
|
/* Remove unused materials */
|
||||||
std::set<pxr::SdfPath> available_materials;
|
std::set<pxr::SdfPath> available_materials;
|
||||||
for (auto &it : objects_.values()) {
|
for (auto &it : objects_.values()) {
|
||||||
|
@ -199,7 +199,8 @@ void CurvesData::write_material()
|
|||||||
pxr::SdfPath p_id = scene_delegate_->material_prim_id(mat);
|
pxr::SdfPath p_id = scene_delegate_->material_prim_id(mat);
|
||||||
mat_data_ = scene_delegate_->material_data(p_id);
|
mat_data_ = scene_delegate_->material_data(p_id);
|
||||||
if (!mat_data_) {
|
if (!mat_data_) {
|
||||||
scene_delegate_->materials_.add_overwrite(p_id, std::make_unique<MaterialData>(scene_delegate_, mat, p_id));
|
scene_delegate_->materials_.add_overwrite(
|
||||||
Vasyl-Pidhirskyi marked this conversation as resolved
Outdated
Georgiy Markelov
commented
seems like here should be seems like here should be `add_new`.
|
|||||||
|
p_id, std::make_unique<MaterialData>(scene_delegate_, mat, p_id));
|
||||||
mat_data_ = scene_delegate_->material_data(p_id);
|
mat_data_ = scene_delegate_->material_data(p_id);
|
||||||
mat_data_->init();
|
mat_data_->init();
|
||||||
mat_data_->insert();
|
mat_data_->insert();
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
#include <pxr/base/vt/value.h>
|
#include <pxr/base/vt/value.h>
|
||||||
#include <pxr/usd/sdf/path.h>
|
#include <pxr/usd/sdf/path.h>
|
||||||
|
|
||||||
#include "DNA_ID.h"
|
|
||||||
#include "BLI_hash.hh"
|
#include "BLI_hash.hh"
|
||||||
|
#include "DNA_ID.h"
|
||||||
|
|
||||||
template<> struct blender::DefaultHash<pxr::SdfPath> {
|
template<> struct blender::DefaultHash<pxr::SdfPath> {
|
||||||
uint64_t operator()(const pxr::SdfPath &value) const
|
uint64_t operator()(const pxr::SdfPath &value) const
|
||||||
|
@ -62,7 +62,6 @@ class InstancerData : public ObjectData {
|
|||||||
pxr::VtMatrix4dArray mesh_transforms_;
|
pxr::VtMatrix4dArray mesh_transforms_;
|
||||||
};
|
};
|
||||||
|
|
||||||
using InstancerDataMap =
|
using InstancerDataMap = Map<pxr::SdfPath, std::unique_ptr<InstancerData>>;
|
||||||
Map<pxr::SdfPath, std::unique_ptr<InstancerData>>;
|
|
||||||
|
|
||||||
} // namespace blender::render::hydra
|
} // namespace blender::render::hydra
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
#include <pxr/usd/sdf/assetPath.h>
|
#include <pxr/usd/sdf/assetPath.h>
|
||||||
#include <pxr/usd/sdf/path.h>
|
#include <pxr/usd/sdf/path.h>
|
||||||
|
|
||||||
#include "DNA_material_types.h"
|
|
||||||
#include "BLI_map.hh"
|
#include "BLI_map.hh"
|
||||||
|
#include "DNA_material_types.h"
|
||||||
|
|
||||||
#include "id.h"
|
#include "id.h"
|
||||||
|
|
||||||
|
@ -304,8 +304,8 @@ void MeshData::write_materials()
|
|||||||
pxr::SdfPath p_id = scene_delegate_->material_prim_id(mat);
|
pxr::SdfPath p_id = scene_delegate_->material_prim_id(mat);
|
||||||
m.mat_data = scene_delegate_->material_data(p_id);
|
m.mat_data = scene_delegate_->material_data(p_id);
|
||||||
if (!m.mat_data) {
|
if (!m.mat_data) {
|
||||||
scene_delegate_->materials_.add_overwrite(p_id,
|
scene_delegate_->materials_.add_overwrite(
|
||||||
Vasyl-Pidhirskyi marked this conversation as resolved
Outdated
Georgiy Markelov
commented
seems like here should be seems like here should be `add_new`.
Bogdan Nagirniak
commented
`lookup_or_add_default`
Vasyl Pidhirskyi
commented
implemented via implemented via `lookup_or_add`
|
|||||||
std::make_unique<MaterialData>(scene_delegate_, mat, p_id));
|
p_id, std::make_unique<MaterialData>(scene_delegate_, mat, p_id));
|
||||||
m.mat_data = scene_delegate_->material_data(p_id);
|
m.mat_data = scene_delegate_->material_data(p_id);
|
||||||
m.mat_data->init();
|
m.mat_data->init();
|
||||||
m.mat_data->insert();
|
m.mat_data->insert();
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
#include <pxr/base/gf/matrix4d.h>
|
#include <pxr/base/gf/matrix4d.h>
|
||||||
|
|
||||||
#include "BKE_layer.h"
|
#include "BKE_layer.h"
|
||||||
#include "DNA_object_types.h"
|
|
||||||
#include "BLI_map.hh"
|
#include "BLI_map.hh"
|
||||||
|
#include "DNA_object_types.h"
|
||||||
|
|
||||||
#include "id.h"
|
#include "id.h"
|
||||||
#include "material.h"
|
#include "material.h"
|
||||||
@ -37,8 +37,7 @@ class ObjectData : public IdData {
|
|||||||
Object *parent_ = nullptr;
|
Object *parent_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
using ObjectDataMap =
|
using ObjectDataMap = Map<pxr::SdfPath, std::unique_ptr<ObjectData>>;
|
||||||
Map<pxr::SdfPath, std::unique_ptr<ObjectData>>;
|
|
||||||
|
|
||||||
pxr::GfMatrix4d gf_matrix_from_transform(float m[4][4]);
|
pxr::GfMatrix4d gf_matrix_from_transform(float m[4][4]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user
rename
val
->obj_data
,i_data
,m_data