forked from blender/blender
Fix review comments #27
@ -85,7 +85,7 @@ void LightData::init()
|
|||||||
/* TODO: temporary value, it should be delivered through Python UI */
|
/* TODO: temporary value, it should be delivered through Python UI */
|
||||||
data_[pxr::HdLightTokens->exposure] = 1.0f;
|
data_[pxr::HdLightTokens->exposure] = 1.0f;
|
||||||
|
|
||||||
set_transform_to_object();
|
write_transform();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LightData::insert()
|
void LightData::insert()
|
||||||
@ -118,7 +118,7 @@ void LightData::update()
|
|||||||
bits = pxr::HdLight::AllDirty;
|
bits = pxr::HdLight::AllDirty;
|
||||||
}
|
}
|
||||||
else if (id->recalc & ID_RECALC_TRANSFORM) {
|
else if (id->recalc & ID_RECALC_TRANSFORM) {
|
||||||
set_transform_to_object();
|
write_transform();
|
||||||
bits = pxr::HdLight::DirtyTransform;
|
bits = pxr::HdLight::DirtyTransform;
|
||||||
}
|
}
|
||||||
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkSprimDirty(prim_id, bits);
|
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkSprimDirty(prim_id, bits);
|
||||||
|
@ -40,7 +40,7 @@ void MeshData::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
write_material();
|
write_material();
|
||||||
set_transform_to_object();
|
write_transform();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeshData::insert()
|
void MeshData::insert()
|
||||||
@ -78,7 +78,7 @@ void MeshData::update()
|
|||||||
bits |= pxr::HdChangeTracker::DirtyMaterialId;
|
bits |= pxr::HdChangeTracker::DirtyMaterialId;
|
||||||
}
|
}
|
||||||
if (id->recalc & ID_RECALC_TRANSFORM) {
|
if (id->recalc & ID_RECALC_TRANSFORM) {
|
||||||
set_transform_to_object();
|
write_transform();
|
||||||
bits |= pxr::HdChangeTracker::DirtyTransform;
|
bits |= pxr::HdChangeTracker::DirtyTransform;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ bool ObjectData::update_visibility()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectData::set_transform_to_object()
|
void ObjectData::write_transform()
|
||||||
{
|
{
|
||||||
transform = gf_matrix_from_transform(((Object *)id)->object_to_world);
|
transform = gf_matrix_from_transform(((Object *)id)->object_to_world);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class ObjectData : public IdData {
|
|||||||
bool visible;
|
bool visible;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void set_transform_to_object();
|
void write_transform();
|
||||||
};
|
};
|
||||||
|
|
||||||
using ObjectDataMap =
|
using ObjectDataMap =
|
||||||
|
@ -49,7 +49,7 @@ void WorldData::init()
|
|||||||
{
|
{
|
||||||
ID_LOG(2, "");
|
ID_LOG(2, "");
|
||||||
|
|
||||||
set_transform();
|
write_transform();
|
||||||
|
|
||||||
World *world = (World *)id;
|
World *world = (World *)id;
|
||||||
data_.clear();
|
data_.clear();
|
||||||
@ -157,7 +157,7 @@ pxr::VtValue WorldData::get_data(pxr::TfToken const &key) const
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldData::set_transform()
|
void WorldData::write_transform()
|
||||||
{
|
{
|
||||||
transform = pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -90), pxr::GfVec3d());
|
transform = pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -90), pxr::GfVec3d());
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class WorldData : public IdData {
|
|||||||
pxr::GfMatrix4d transform;
|
pxr::GfMatrix4d transform;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set_transform();
|
void write_transform();
|
||||||
|
|
||||||
std::map<pxr::TfToken, pxr::VtValue> data_;
|
std::map<pxr::TfToken, pxr::VtValue> data_;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user