Hydra: add support for legacy hair particles #114197
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#114197
Loading…
Reference in New Issue
No description provided.
Delete Branch "DagerD/blender:hydra-add-legacy-hair-particles"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose
Add support for legacy hair particles
Technical steps
Added class
HairData
Ref #110765
Code improvements are required
@ -36,3 +37,3 @@
void insert() override;
void remove() override;
void update() override;
virtual void update() override;
this is already virtual
@ -254,6 +257,12 @@ pxr::SdfPath HydraSceneDelegate::material_prim_id(const Material *mat) const
return prim_id((ID *)mat, "M");
}
pxr::SdfPath HydraSceneDelegate::hair_prim_id(const pxr::SdfPath parent_obj,
consider name
psys_prim_id
, changepxr::SdfPath parent_obj
toObject *obj
@ -257,0 +260,4 @@
pxr::SdfPath HydraSceneDelegate::hair_prim_id(const pxr::SdfPath parent_obj,
const ParticleSystem *psys) const
{
return parent_obj.AppendPath(pxr::SdfPath(prim_id((ID *)psys, "H").GetName()));
Consider id as:
<O_...>_<PS_...>
@ -520,6 +517,49 @@ void HydraSceneDelegate::update_collection()
});
}
void HydraSceneDelegate::update_object(Set<std::string> &available_objects, Object *object)
move this function as internal to update_collection()
auto update_object = [&available_objects](Object *object) {...};
@ -523,0 +524,4 @@
continue;
}
if (HairData::is_supported(psys) && HairData::is_visible(this, object, psys)) {
pxr::SdfPath psys_path = hair_prim_id(object_prim_id(object), psys);
psys_path -> id
@ -523,0 +525,4 @@
}
if (HairData::is_supported(psys) && HairData::is_visible(this, object, psys)) {
pxr::SdfPath psys_path = hair_prim_id(object_prim_id(object), psys);
ObjectData *psys_data = object_data(psys_path);
`HairData *h_data = hair_data(psys_path);
@ -182,0 +194,4 @@
bool HairData::is_supported(const ParticleSystem *particle_system)
{
if (particle_system->part && particle_system->part->type == PART_HAIR) {
simplify to
return particle_system->part && particle_system->part->type == PART_HAIR
@ -182,0 +213,4 @@
ID_LOGN(1, "");
if (psys_in_edit_mode(scene_delegate_->depsgraph, particle_system_)) {
return;
This doesn't suit to scene delegate design, there shouldn't be uninited objects. This check has to be made before calling init()
@ -182,0 +227,4 @@
if (particle_system_->part->type != PART_HAIR) {
CLOG_WARN(LOG_HYDRA_SCENE, "Unsupported particle type: %d", particle_system_->part->type);
if (scene_delegate_->GetRenderIndex().HasRprim(prim_id)) {
remove();
This shouldn't be there. It should be on scene delegate side
@ -94,6 +94,7 @@ class HydraSceneDelegate : public pxr::HdSceneDelegate {
pxr::SdfPath prim_id(const ID *id, const char *prefix) const;
pxr::SdfPath object_prim_id(const Object *object) const;
pxr::SdfPath material_prim_id(const Material *mat) const;
pxr::SdfPath psys_prim_id(Object *parent_obj, const ParticleSystem *mat) const;
Seems hair_prim_id suits better here
Please check UVs, looks like current result is incorrect.
Agree about UVs
Tested - works good
Works as intended.
@brecht please review
@blender-bot build
@blender-bot build
Reminder to solve, some warnings to fix before merging:
https://builder.blender.org/admin/#/builders/132/builds/3296
https://builder.blender.org/admin/#/builders/134/builds/3353
https://builder.blender.org/admin/#/builders/133/builds/3155
@blender-bot build
@blender-bot build