Export curves #46

Merged
Bogdan Nagirniak merged 7 commits from BLEN-364 into hydra-render 2023-05-29 11:45:41 +02:00
4 changed files with 11 additions and 11 deletions
Showing only changes of commit 09fad82b51 - Show all commits

View File

@ -27,7 +27,8 @@ pxr::HdMeshTopology BlenderSceneDelegate::GetMeshTopology(pxr::SdfPath const &id
return m_data->mesh_topology(id); return m_data->mesh_topology(id);
} }
pxr::HdBasisCurvesTopology BlenderSceneDelegate::GetBasisCurvesTopology(pxr::SdfPath const& id) { pxr::HdBasisCurvesTopology BlenderSceneDelegate::GetBasisCurvesTopology(pxr::SdfPath const &id)
{
CLOG_INFO(LOG_RENDER_HYDRA_SCENE, 3, "%s", id.GetText()); CLOG_INFO(LOG_RENDER_HYDRA_SCENE, 3, "%s", id.GetText());
CurvesData *c_data = curves_data(id); CurvesData *c_data = curves_data(id);
return c_data->curves_topology(id); return c_data->curves_topology(id);

View File

@ -11,12 +11,12 @@
#include "CLG_log.h" #include "CLG_log.h"
#include "curves.h"
#include "instancer.h" #include "instancer.h"
#include "light.h" #include "light.h"
#include "mesh.h" #include "mesh.h"
#include "object.h" #include "object.h"
#include "world.h" #include "world.h"
#include "curves.h"
namespace blender::render::hydra { namespace blender::render::hydra {

View File

@ -4,18 +4,17 @@
#include <pxr/base/gf/vec2f.h> #include <pxr/base/gf/vec2f.h>
#include <pxr/imaging/hd/tokens.h> #include <pxr/imaging/hd/tokens.h>
#include "BKE_customdata.h"
#include "BKE_material.h" #include "BKE_material.h"
#include "BKE_object.h" #include "BKE_object.h"
#include "BKE_customdata.h"
#include "blender_scene_delegate.h" #include "blender_scene_delegate.h"
namespace blender::render::hydra { namespace blender::render::hydra {
CurvesData::CurvesData(BlenderSceneDelegate *scene_delegate, CurvesData::CurvesData(BlenderSceneDelegate *scene_delegate,
Object *object, Object *object,
pxr::SdfPath const &prim_id) pxr::SdfPath const &prim_id)
: ObjectData(scene_delegate, object, prim_id) : ObjectData(scene_delegate, object, prim_id)
{ {
} }
@ -33,8 +32,8 @@ void CurvesData::init()
void CurvesData::insert() void CurvesData::insert()
{ {
ID_LOG(2, ""); ID_LOG(2, "");
scene_delegate_->GetRenderIndex().InsertRprim(pxr::HdPrimTypeTokens->basisCurves, scene_delegate_, scene_delegate_->GetRenderIndex().InsertRprim(
prim_id); pxr::HdPrimTypeTokens->basisCurves, scene_delegate_, prim_id);
} }
void CurvesData::remove() void CurvesData::remove()
@ -88,7 +87,7 @@ bool CurvesData::update_visibility()
bool ret = ObjectData::update_visibility(); bool ret = ObjectData::update_visibility();
if (ret) { if (ret) {
scene_delegate_->GetRenderIndex().GetChangeTracker().MarkRprimDirty( scene_delegate_->GetRenderIndex().GetChangeTracker().MarkRprimDirty(
prim_id, pxr::HdChangeTracker::DirtyVisibility); prim_id, pxr::HdChangeTracker::DirtyVisibility);
ID_LOG(2, ""); ID_LOG(2, "");
} }
return ret; return ret;
@ -147,7 +146,7 @@ void CurvesData::write_curves(Curves *curves)
curve_vertex_counts_.clear(); curve_vertex_counts_.clear();
widths_.clear(); widths_.clear();
vertices_.clear(); vertices_.clear();
const float *radii = (const float *)CustomData_get_layer_named( const float *radii = (const float *)CustomData_get_layer_named(
&curves->geometry.point_data, CD_PROP_FLOAT, "radius"); &curves->geometry.point_data, CD_PROP_FLOAT, "radius");
const float(*positions)[3] = (const float(*)[3])CustomData_get_layer_named( const float(*positions)[3] = (const float(*)[3])CustomData_get_layer_named(

View File

@ -5,9 +5,9 @@
#include "DEG_depsgraph_query.h" #include "DEG_depsgraph_query.h"
#include "blender_scene_delegate.h" #include "blender_scene_delegate.h"
#include "curves.h"
#include "light.h" #include "light.h"
#include "mesh.h" #include "mesh.h"
#include "curves.h"
#include "object.h" #include "object.h"
namespace blender::render::hydra { namespace blender::render::hydra {