Page MenuHome

CustomData: add float2 and float3 data types
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Jul 8 2020, 5:43 PM.

Details

Summary

This adds CD_PROP_FLOAT2 and CD_PROP_FLOAT3.
"Float2" and "Float3" don't necessarily have to be used in the UI.
Have a look at T71384 to see how data types are called in different programs.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Jul 8 2020, 5:43 PM
Jacques Lucke (JacquesLucke) added inline comments.
source/blender/blenkernel/intern/customdata.c
1900

The N_("Float3") name should not be used. I just have to provide a default name to tell the system that multiple layers of this type can exist.

Hi @Jacques Lucke (JacquesLucke) , I was also working on CD_PROP_VECTOR (I only looked at 3d, but 2d should be there as well, right), but including appropriate LayerTypeInfo functions (interp, equal, add, ...).
Think it would be good to have these included right away [to provide something for modeling tools to treat CD_PROP layers properly]?

Will post what I have later today.

source/blender/makesdna/DNA_customdata_types.h
214–216

in D8200, this will be replaced by CD_MASK_PROP_ALL.
(just saying, depends on what will land first)

@Philipp Oeser (lichtwerk) Feel free to post/commit what you have. I don't need all the interpolation stuff yet, so I did not add it.

I prefer the internal name CD_PROP_FLOAT3 over CD_PROP_VECTOR. It is more explicit and matches the C++ type name defined in BLI_float3.hh.

@Philipp Oeser (lichtwerk) Feel free to post/commit what you have. I don't need all the interpolation stuff yet, so I did not add it.

I prefer the internal name CD_PROP_FLOAT3 over CD_PROP_VECTOR. It is more explicit and matches the C++ type name defined in BLI_float3.hh.

Unfortunately I didnt get to finish it before my holidays [which have started now], so from my side, go ahead, we can always add relevant functions later.

Brecht Van Lommel (brecht) requested changes to this revision.Jul 13 2020, 7:51 PM

I think interpolation and similar functions should be added along with this, would rather not commit this half-finished.

This revision now requires changes to proceed.Jul 13 2020, 7:51 PM

I added some of the callbacks. I noticed that CD_PROP_FLOAT
and CD_PROP_INT32 don't have most of the callbacks either.

Unfortunately, I don't really know how to test these callbacks
in a good way. They compile for me, but I've never called them...

This revision is now accepted and ready to land.Jul 15 2020, 4:30 PM

Adding similar functions for CD_PROP_FLOAT would be good as well.

These generic attributes are quite hidden not used much, but when they start getting exposed in the UI this will become a problem.