Page MenuHome

Initialize ATTR_SURFACE_TRIANGLE_INDEX
ClosedPublic

Authored by Angus Stanton (abstanton) on Apr 7 2022, 4:08 PM.

Details

Summary

If ATTR_SURFACE_TRIANGLE_INDEX does not already exist,
fill it with -1 on getting for write.

Diff Detail

Repository
rB Blender
Branch
T97138-initialize-curve-attributes (branched from master)
Build Status
Buildable 21512
Build 21512: arc lint + arc unit

Event Timeline

Angus Stanton (abstanton) requested review of this revision.Apr 7 2022, 4:08 PM
Angus Stanton (abstanton) created this revision.
Jacques Lucke (JacquesLucke) requested changes to this revision.Apr 7 2022, 6:14 PM

Thanks for the patch. I think this should be generalized a bit, i.e. the expected default value should be passed to get_mutable_attribute.

This revision now requires changes to proceed.Apr 7 2022, 6:14 PM

Thanks for the patch. I think this should be generalized a bit, i.e. the expected default value should be passed to get_mutable_attribute.

Shall I overload get_mutable_attribute with a new function that takes a default value, or shall I change the existing implementation and change all it's call sites?

Angus Stanton (abstanton) updated this revision to Diff 50234.EditedApr 8 2022, 2:58 AM
  • Overload get_mutable_attribute to accept default value

Thought I'd go with overloading for now, can convert all function calls to use the default value accepting function if needed

Think it would be better to always pass a default value to get_mutable_attribute. get_mutable_attribute could be smart enough to not initialize new attribute layers twice in case the default value is zero. That can also be handled separately though.

  • Use default value for all uses of get_mutable_attribute
This revision is now accepted and ready to land.Apr 9 2022, 10:44 AM