Cleanup: Remove unnecessary struct keyword from C++ headers

Pull Request: https://projects.blender.org/blender/blender/pulls/110734
This commit is contained in:
Hans Goudey
2023-08-03 01:11:28 +02:00
committed by Hans Goudey
parent 731d296f35
commit 8bb8cfb54e
78 changed files with 1207 additions and 1310 deletions

View File

@@ -228,7 +228,7 @@ std::string AS_asset_library_find_suitable_root_path_from_path(blender::StringRe
* r_library_path. If \a bmain wasn't saved into a file yet, the return value will be
* false.
*/
std::string AS_asset_library_find_suitable_root_path_from_main(const struct Main *bmain);
std::string AS_asset_library_find_suitable_root_path_from_main(const Main *bmain);
blender::asset_system::AssetCatalogService *AS_asset_library_get_catalog_service(
const ::AssetLibrary *library);

View File

@@ -28,8 +28,8 @@ struct UnifiedPaintSettings;
/* Globals for brush execution. */
void BKE_brush_system_init(void);
void BKE_brush_system_exit(void);
void BKE_brush_system_init();
void BKE_brush_system_exit();
/* Data-block functions. */
@@ -37,67 +37,64 @@ void BKE_brush_system_exit(void);
* \note Resulting brush will have two users: one as a fake user,
* another is assumed to be used by the caller.
*/
struct Brush *BKE_brush_add(struct Main *bmain, const char *name, eObjectMode ob_mode);
Brush *BKE_brush_add(Main *bmain, const char *name, eObjectMode ob_mode);
/**
* Add a new gp-brush.
*/
struct Brush *BKE_brush_add_gpencil(struct Main *bmain,
struct ToolSettings *ts,
const char *name,
eObjectMode mode);
Brush *BKE_brush_add_gpencil(Main *bmain, ToolSettings *ts, const char *name, eObjectMode mode);
/**
* Delete a Brush.
*/
bool BKE_brush_delete(struct Main *bmain, struct Brush *brush);
bool BKE_brush_delete(Main *bmain, Brush *brush);
/**
* Add grease pencil settings.
*/
void BKE_brush_init_gpencil_settings(struct Brush *brush);
void BKE_brush_init_gpencil_settings(Brush *brush);
void BKE_brush_init_curves_sculpt_settings(struct Brush *brush);
void BKE_brush_init_curves_sculpt_settings(Brush *brush);
struct Brush *BKE_brush_first_search(struct Main *bmain, eObjectMode ob_mode);
Brush *BKE_brush_first_search(Main *bmain, eObjectMode ob_mode);
void BKE_brush_sculpt_reset(struct Brush *brush);
void BKE_brush_sculpt_reset(Brush *brush);
/**
* Create a set of grease pencil Drawing presets.
*/
void BKE_brush_gpencil_paint_presets(struct Main *bmain, struct ToolSettings *ts, bool reset);
void BKE_brush_gpencil_paint_presets(Main *bmain, ToolSettings *ts, bool reset);
/**
* Create a set of grease pencil Vertex Paint presets.
*/
void BKE_brush_gpencil_vertex_presets(struct Main *bmain, struct ToolSettings *ts, bool reset);
void BKE_brush_gpencil_vertex_presets(Main *bmain, ToolSettings *ts, bool reset);
/**
* Create a set of grease pencil Sculpt Paint presets.
*/
void BKE_brush_gpencil_sculpt_presets(struct Main *bmain, struct ToolSettings *ts, bool reset);
void BKE_brush_gpencil_sculpt_presets(Main *bmain, ToolSettings *ts, bool reset);
/**
* Create a set of grease pencil Weight Paint presets.
*/
void BKE_brush_gpencil_weight_presets(struct Main *bmain, struct ToolSettings *ts, bool reset);
void BKE_gpencil_brush_preset_set(struct Main *bmain, struct Brush *brush, short type);
void BKE_brush_gpencil_weight_presets(Main *bmain, ToolSettings *ts, bool reset);
void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, short type);
void BKE_brush_jitter_pos(const struct Scene *scene,
struct Brush *brush,
void BKE_brush_jitter_pos(const Scene *scene,
Brush *brush,
const float pos[2],
float jitterpos[2]);
void BKE_brush_randomize_texture_coords(struct UnifiedPaintSettings *ups, bool mask);
void BKE_brush_randomize_texture_coords(UnifiedPaintSettings *ups, bool mask);
/* Brush curve. */
/**
* Library Operations
*/
void BKE_brush_curve_preset(struct Brush *b, enum eCurveMappingPreset preset);
void BKE_brush_curve_preset(Brush *b, enum eCurveMappingPreset preset);
/**
* Uses the brush curve control to find a strength value between 0 and 1.
*/
float BKE_brush_curve_strength_clamped(const struct Brush *br, float p, float len);
float BKE_brush_curve_strength_clamped(const Brush *br, float p, float len);
/**
* Uses the brush curve control to find a strength value.
*/
float BKE_brush_curve_strength(const struct Brush *br, float p, float len);
float BKE_brush_curve_strength(const Brush *br, float p, float len);
/* Sampling. */
@@ -108,18 +105,15 @@ float BKE_brush_curve_strength(const struct Brush *br, float p, float len);
*
* RGBA outputs straight alpha.
*/
float BKE_brush_sample_tex_3d(const struct Scene *scene,
const struct Brush *br,
const struct MTex *mtex,
float BKE_brush_sample_tex_3d(const Scene *scene,
const Brush *br,
const MTex *mtex,
const float point[3],
float rgba[4],
int thread,
struct ImagePool *pool);
float BKE_brush_sample_masktex(const struct Scene *scene,
struct Brush *br,
const float point[2],
int thread,
struct ImagePool *pool);
ImagePool *pool);
float BKE_brush_sample_masktex(
const Scene *scene, Brush *br, const float point[2], int thread, ImagePool *pool);
/**
* Get the mask texture for this given object mode.
@@ -127,8 +121,7 @@ float BKE_brush_sample_masktex(const struct Scene *scene,
* This is preferred above using mtex/mask_mtex attributes directly as due to legacy these
* attributes got switched in sculpt mode.
*/
const struct MTex *BKE_brush_mask_texture_get(const struct Brush *brush,
const eObjectMode object_mode);
const MTex *BKE_brush_mask_texture_get(const Brush *brush, const eObjectMode object_mode);
/**
* Get the color texture for this given object mode.
@@ -136,40 +129,35 @@ const struct MTex *BKE_brush_mask_texture_get(const struct Brush *brush,
* This is preferred above using mtex/mask_mtex attributes directly as due to legacy these
* attributes got switched in sculpt mode.
*/
const struct MTex *BKE_brush_color_texture_get(const struct Brush *brush,
const eObjectMode object_mode);
const MTex *BKE_brush_color_texture_get(const Brush *brush, const eObjectMode object_mode);
/**
* Radial control.
*/
struct ImBuf *BKE_brush_gen_radial_control_imbuf(struct Brush *br,
bool secondary,
bool display_gradient);
ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary, bool display_gradient);
/* Unified strength size and color. */
const float *BKE_brush_color_get(const struct Scene *scene, const struct Brush *brush);
const float *BKE_brush_secondary_color_get(const struct Scene *scene, const struct Brush *brush);
void BKE_brush_color_set(struct Scene *scene, struct Brush *brush, const float color[3]);
const float *BKE_brush_color_get(const Scene *scene, const Brush *brush);
const float *BKE_brush_secondary_color_get(const Scene *scene, const Brush *brush);
void BKE_brush_color_set(Scene *scene, Brush *brush, const float color[3]);
int BKE_brush_size_get(const struct Scene *scene, const struct Brush *brush);
void BKE_brush_size_set(struct Scene *scene, struct Brush *brush, int size);
int BKE_brush_size_get(const Scene *scene, const Brush *brush);
void BKE_brush_size_set(Scene *scene, Brush *brush, int size);
float BKE_brush_unprojected_radius_get(const struct Scene *scene, const struct Brush *brush);
void BKE_brush_unprojected_radius_set(struct Scene *scene,
struct Brush *brush,
float unprojected_radius);
float BKE_brush_unprojected_radius_get(const Scene *scene, const Brush *brush);
void BKE_brush_unprojected_radius_set(Scene *scene, Brush *brush, float unprojected_radius);
float BKE_brush_alpha_get(const struct Scene *scene, const struct Brush *brush);
void BKE_brush_alpha_set(struct Scene *scene, struct Brush *brush, float alpha);
float BKE_brush_weight_get(const struct Scene *scene, const struct Brush *brush);
void BKE_brush_weight_set(const struct Scene *scene, struct Brush *brush, float value);
float BKE_brush_alpha_get(const Scene *scene, const Brush *brush);
void BKE_brush_alpha_set(Scene *scene, Brush *brush, float alpha);
float BKE_brush_weight_get(const Scene *scene, const Brush *brush);
void BKE_brush_weight_set(const Scene *scene, Brush *brush, float value);
bool BKE_brush_use_locked_size(const struct Scene *scene, const struct Brush *brush);
bool BKE_brush_use_alpha_pressure(const struct Brush *brush);
bool BKE_brush_use_size_pressure(const struct Brush *brush);
bool BKE_brush_use_locked_size(const Scene *scene, const Brush *brush);
bool BKE_brush_use_alpha_pressure(const Brush *brush);
bool BKE_brush_use_size_pressure(const Brush *brush);
bool BKE_brush_sculpt_has_secondary_color(const struct Brush *brush);
bool BKE_brush_sculpt_has_secondary_color(const Brush *brush);
/**
* Scale unprojected radius to reflect a change in the brush's 2D size.
@@ -188,18 +176,18 @@ void BKE_brush_scale_size(int *r_brush_size,
/* Returns true if a brush requires a cube
* (often presented to the user as a square) tip inside a specific paint mode.
*/
bool BKE_brush_has_cube_tip(const struct Brush *brush, ePaintMode paint_mode);
bool BKE_brush_has_cube_tip(const Brush *brush, ePaintMode paint_mode);
/* Accessors */
#define BKE_brush_tool_get(brush, p) \
(CHECK_TYPE_ANY(brush, struct Brush *, const struct Brush *), \
(CHECK_TYPE_ANY(brush, Brush *, const Brush *), \
*(const char *)POINTER_OFFSET(brush, (p)->runtime.tool_offset))
#define BKE_brush_tool_set(brush, p, tool) \
{ \
CHECK_TYPE_ANY(brush, struct Brush *); \
CHECK_TYPE_ANY(brush, Brush *); \
*(char *)POINTER_OFFSET(brush, (p)->runtime.tool_offset) = tool; \
} \
((void)0)
/* debugging only */
void BKE_brush_debug_print_state(struct Brush *br);
void BKE_brush_debug_print_state(Brush *br);

View File

@@ -100,7 +100,7 @@ struct CryptomatteLayer {
#endif
static std::unique_ptr<CryptomatteLayer> read_from_manifest(blender::StringRefNull manifest);
uint32_t add_ID(const struct ID &id);
uint32_t add_ID(const ID &id);
void add_hash(blender::StringRef name, CryptomatteHash cryptomatte_hash);
std::string manifest() const;
@@ -108,7 +108,7 @@ struct CryptomatteLayer {
};
struct CryptomatteStampDataCallbackData {
struct CryptomatteSession *session;
CryptomatteSession *session;
blender::Map<std::string, std::string> hash_to_layer_name;
/**

View File

@@ -13,8 +13,8 @@ namespace blender::bke {
/**
* \note This doesn't extract instances from the "dupli" system for non-geometry-nodes instances.
*/
GeometrySet object_get_evaluated_geometry_set(const struct Object &object);
GeometrySet object_get_evaluated_geometry_set(const Object &object);
bool object_has_geometry_set_instances(const struct Object &object);
bool object_has_geometry_set_instances(const Object &object);
} // namespace blender::bke

View File

@@ -90,11 +90,11 @@ enum class ePartialUpdateIterResult {
* last invoke for the same user. The changes can be read by using
* #BKE_image_partial_update_get_next_change.
*/
ePartialUpdateCollectResult BKE_image_partial_update_collect_changes(
struct Image *image, struct PartialUpdateUser *user);
ePartialUpdateCollectResult BKE_image_partial_update_collect_changes(Image *image,
PartialUpdateUser *user);
ePartialUpdateIterResult BKE_image_partial_update_get_next_change(
struct PartialUpdateUser *user, struct PartialUpdateRegion *r_region);
ePartialUpdateIterResult BKE_image_partial_update_get_next_change(PartialUpdateUser *user,
PartialUpdateRegion *r_region);
/** \brief Abstract class to load tile data when using the PartialUpdateChecker. */
class AbstractTileData {

View File

@@ -41,20 +41,19 @@ struct ViewLayer;
/**
* Initialize empty overriding of \a reference_id by \a local_id.
*/
struct IDOverrideLibrary *BKE_lib_override_library_init(struct ID *local_id,
struct ID *reference_id);
IDOverrideLibrary *BKE_lib_override_library_init(ID *local_id, ID *reference_id);
/**
* Shallow or deep copy of a whole override from \a src_id to \a dst_id.
*/
void BKE_lib_override_library_copy(struct ID *dst_id, const struct ID *src_id, bool do_full_copy);
void BKE_lib_override_library_copy(ID *dst_id, const ID *src_id, bool do_full_copy);
/**
* Clear any overriding data from given \a liboverride.
*/
void BKE_lib_override_library_clear(struct IDOverrideLibrary *liboverride, bool do_id_user);
void BKE_lib_override_library_clear(IDOverrideLibrary *liboverride, bool do_id_user);
/**
* Free given \a liboverride.
*/
void BKE_lib_override_library_free(struct IDOverrideLibrary **liboverride, bool do_id_user);
void BKE_lib_override_library_free(IDOverrideLibrary **liboverride, bool do_id_user);
/**
* Return the actual #IDOverrideLibrary data 'controlling' the given `id`, and the actual ID owning
@@ -66,20 +65,20 @@ void BKE_lib_override_library_free(struct IDOverrideLibrary **liboverride, bool
* \param owner_id_hint: If not NULL, a potential owner for the given override-embedded `id`.
* \param r_owner_id: If given, will be set with the actual ID owning the return liboverride data.
*/
struct IDOverrideLibrary *BKE_lib_override_library_get(struct Main *bmain,
struct ID *id,
struct ID *owner_id_hint,
struct ID **r_owner_id);
IDOverrideLibrary *BKE_lib_override_library_get(Main *bmain,
ID *id,
ID *owner_id_hint,
ID **r_owner_id);
/**
* Check if given ID has some override rules that actually indicate the user edited it.
*/
bool BKE_lib_override_library_is_user_edited(const struct ID *id);
bool BKE_lib_override_library_is_user_edited(const ID *id);
/**
* Check if given ID is a system override.
*/
bool BKE_lib_override_library_is_system_defined(const struct Main *bmain, const struct ID *id);
bool BKE_lib_override_library_is_system_defined(const Main *bmain, const ID *id);
/**
* Check if given Override Property for given ID is animated (through a F-Curve in an Action, or
@@ -90,9 +89,9 @@ bool BKE_lib_override_library_is_system_defined(const struct Main *bmain, const
* \param rnaprop_index: Array in the RNA property, 0 if unknown or irrelevant.
*/
bool BKE_lib_override_library_property_is_animated(
const struct ID *id,
const struct IDOverrideLibraryProperty *liboverride_prop,
const struct PropertyRNA *override_rna_prop,
const ID *id,
const IDOverrideLibraryProperty *liboverride_prop,
const PropertyRNA *override_rna_prop,
const int rnaprop_index);
/**
@@ -101,7 +100,7 @@ bool BKE_lib_override_library_property_is_animated(
*
* NOTE: Embedded IDs of override IDs are not considered as leaves.
*/
bool BKE_lib_override_library_is_hierarchy_leaf(struct Main *bmain, struct ID *id);
bool BKE_lib_override_library_is_hierarchy_leaf(Main *bmain, ID *id);
/**
* Create an overridden local copy of linked reference.
@@ -109,9 +108,7 @@ bool BKE_lib_override_library_is_hierarchy_leaf(struct Main *bmain, struct ID *i
* \note This function is very basic, low-level. It does not consider any hierarchical dependency,
* and also prevents any automatic re-sync of this local override.
*/
struct ID *BKE_lib_override_library_create_from_id(struct Main *bmain,
struct ID *reference_id,
bool do_tagged_remap);
ID *BKE_lib_override_library_create_from_id(Main *bmain, ID *reference_id, bool do_tagged_remap);
/**
* Create overridden local copies of all tagged data-blocks in given Main.
*
@@ -146,11 +143,11 @@ struct ID *BKE_lib_override_library_create_from_id(struct Main *bmain,
*
* \return \a true on success, \a false otherwise.
*/
bool BKE_lib_override_library_create_from_tag(struct Main *bmain,
struct Library *owner_library,
const struct ID *id_root_reference,
struct ID *id_hierarchy_root,
const struct ID *id_hierarchy_root_reference,
bool BKE_lib_override_library_create_from_tag(Main *bmain,
Library *owner_library,
const ID *id_root_reference,
ID *id_hierarchy_root,
const ID *id_hierarchy_root_reference,
bool do_no_main,
const bool do_fully_editable);
/**
@@ -187,19 +184,19 @@ bool BKE_lib_override_library_create_from_tag(struct Main *bmain,
*
* \return true if override was successfully created.
*/
bool BKE_lib_override_library_create(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer,
struct Library *owner_library,
struct ID *id_root_reference,
struct ID *id_hierarchy_root_reference,
struct ID *id_instance_hint,
struct ID **r_id_root_override,
bool BKE_lib_override_library_create(Main *bmain,
Scene *scene,
ViewLayer *view_layer,
Library *owner_library,
ID *id_root_reference,
ID *id_hierarchy_root_reference,
ID *id_instance_hint,
ID **r_id_root_override,
const bool do_fully_editable);
/**
* Create a library override template.
*/
bool BKE_lib_override_library_template_create(struct ID *id);
bool BKE_lib_override_library_template_create(ID *id);
/**
* Convert a given proxy object into a library override.
*
@@ -210,17 +207,16 @@ bool BKE_lib_override_library_template_create(struct ID *id);
* which case \a scene's master collection children hierarchy is used instead).
* \return true if override was successfully created.
*/
bool BKE_lib_override_library_proxy_convert(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer,
struct Object *ob_proxy);
bool BKE_lib_override_library_proxy_convert(Main *bmain,
Scene *scene,
ViewLayer *view_layer,
Object *ob_proxy);
/**
* Convert all proxy objects into library overrides.
*
* \note Only affects local proxies, linked ones are not affected.
*/
void BKE_lib_override_library_main_proxy_convert(struct Main *bmain,
struct BlendFileReadReport *reports);
void BKE_lib_override_library_main_proxy_convert(Main *bmain, BlendFileReadReport *reports);
/**
* Find and set the 'hierarchy root' ID pointer of all library overrides in given `bmain`.
@@ -228,7 +224,7 @@ void BKE_lib_override_library_main_proxy_convert(struct Main *bmain,
* NOTE: Cannot be called from `do_versions_after_linking` as this code needs a single complete
* Main database, not a split-by-libraries one.
*/
void BKE_lib_override_library_main_hierarchy_root_ensure(struct Main *bmain);
void BKE_lib_override_library_main_hierarchy_root_ensure(Main *bmain);
/**
* Advanced 'smart' function to resync, re-create fully functional overrides up-to-date with linked
@@ -239,13 +235,13 @@ void BKE_lib_override_library_main_hierarchy_root_ensure(struct Main *bmain);
* \param id_root: The root liboverride ID to resync from.
* \return true if override was successfully resynced.
*/
bool BKE_lib_override_library_resync(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer,
struct ID *id_root,
struct Collection *override_resync_residual_storage,
bool BKE_lib_override_library_resync(Main *bmain,
Scene *scene,
ViewLayer *view_layer,
ID *id_root,
Collection *override_resync_residual_storage,
bool do_hierarchy_enforce,
struct BlendFileReadReport *reports);
BlendFileReadReport *reports);
/**
* Detect and handle required resync of overrides data, when relations between reference linked IDs
* have changed.
@@ -263,10 +259,10 @@ bool BKE_lib_override_library_resync(struct Main *bmain,
* \param view_layer: the active view layer to search instantiated collections in, can be NULL (in
* which case \a scene's master collection children hierarchy is used instead).
*/
void BKE_lib_override_library_main_resync(struct Main *bmain,
struct Scene *scene,
struct ViewLayer *view_layer,
struct BlendFileReadReport *reports);
void BKE_lib_override_library_main_resync(Main *bmain,
Scene *scene,
ViewLayer *view_layer,
BlendFileReadReport *reports);
/**
* Advanced 'smart' function to delete library overrides (including their existing override
@@ -276,7 +272,7 @@ void BKE_lib_override_library_main_resync(struct Main *bmain,
*
* \param id_root: The root liboverride ID to delete.
*/
void BKE_lib_override_library_delete(struct Main *bmain, struct ID *id_root);
void BKE_lib_override_library_delete(Main *bmain, ID *id_root);
/**
* Make given ID fully local.
@@ -284,29 +280,30 @@ void BKE_lib_override_library_delete(struct Main *bmain, struct ID *id_root);
* \note Only differs from lower-level #BKE_lib_override_library_free in infamous embedded ID
* cases.
*/
void BKE_lib_override_library_make_local(struct ID *id);
void BKE_lib_override_library_make_local(ID *id);
/**
* Find override property from given RNA path, if it exists.
*/
struct IDOverrideLibraryProperty *BKE_lib_override_library_property_find(
struct IDOverrideLibrary *override, const char *rna_path);
IDOverrideLibraryProperty *BKE_lib_override_library_property_find(IDOverrideLibrary *override,
const char *rna_path);
/**
* Find override property from given RNA path, or create it if it does not exist.
*/
struct IDOverrideLibraryProperty *BKE_lib_override_library_property_get(
struct IDOverrideLibrary *override, const char *rna_path, bool *r_created);
IDOverrideLibraryProperty *BKE_lib_override_library_property_get(IDOverrideLibrary *override,
const char *rna_path,
bool *r_created);
/**
* Remove and free given \a liboverride_property from given ID \a liboverride.
*/
void BKE_lib_override_library_property_delete(
struct IDOverrideLibrary *liboverride, struct IDOverrideLibraryProperty *liboverride_property);
void BKE_lib_override_library_property_delete(IDOverrideLibrary *liboverride,
IDOverrideLibraryProperty *liboverride_property);
/**
* Delete a property override from the given ID \a liboverride, if it exists.
*
* \return True when the property was found (and thus deleted), false if it wasn't found.
*/
bool BKE_lib_override_library_property_search_and_delete(struct IDOverrideLibrary *liboverride,
bool BKE_lib_override_library_property_search_and_delete(IDOverrideLibrary *liboverride,
const char *rna_path);
/**
@@ -320,7 +317,7 @@ bool BKE_lib_override_library_property_search_and_delete(struct IDOverrideLibrar
* the caller will retain ownership of the passed pointer.
* \return True if the property was found (and thus changed), false if it wasn't found.
*/
bool BKE_lib_override_library_property_rna_path_change(struct IDOverrideLibrary *liboverride,
bool BKE_lib_override_library_property_rna_path_change(IDOverrideLibrary *liboverride,
const char *old_rna_path,
const char *new_rna_path);
@@ -333,17 +330,17 @@ bool BKE_lib_override_library_property_rna_path_change(struct IDOverrideLibrary
* \param r_index: The RNA array flat index (i.e. flattened index in case of multi-dimensional
* array properties). See #RNA_path_resolve_full family of functions for details.
*/
bool BKE_lib_override_rna_property_find(struct PointerRNA *idpoin,
const struct IDOverrideLibraryProperty *library_prop,
struct PointerRNA *r_override_poin,
struct PropertyRNA **r_override_prop,
bool BKE_lib_override_rna_property_find(PointerRNA *idpoin,
const IDOverrideLibraryProperty *library_prop,
PointerRNA *r_override_poin,
PropertyRNA **r_override_prop,
int *r_index);
/**
* Find override property operation from given sub-item(s), if it exists.
*/
struct IDOverrideLibraryPropertyOperation *BKE_lib_override_library_property_operation_find(
struct IDOverrideLibraryProperty *liboverride_property,
IDOverrideLibraryPropertyOperation *BKE_lib_override_library_property_operation_find(
IDOverrideLibraryProperty *liboverride_property,
const char *subitem_refname,
const char *subitem_locname,
int subitem_refindex,
@@ -353,8 +350,8 @@ struct IDOverrideLibraryPropertyOperation *BKE_lib_override_library_property_ope
/**
* Find override property operation from given sub-item(s), or create it if it does not exist.
*/
struct IDOverrideLibraryPropertyOperation *BKE_lib_override_library_property_operation_get(
struct IDOverrideLibraryProperty *liboverride_property,
IDOverrideLibraryPropertyOperation *BKE_lib_override_library_property_operation_get(
IDOverrideLibraryProperty *liboverride_property,
short operation,
const char *subitem_refname,
const char *subitem_locname,
@@ -367,31 +364,29 @@ struct IDOverrideLibraryPropertyOperation *BKE_lib_override_library_property_ope
* Remove and free given \a liboverride_property_operation from given ID \a liboverride_property.
*/
void BKE_lib_override_library_property_operation_delete(
struct IDOverrideLibraryProperty *liboverride_property,
struct IDOverrideLibraryPropertyOperation *liboverride_property_operation);
IDOverrideLibraryProperty *liboverride_property,
IDOverrideLibraryPropertyOperation *liboverride_property_operation);
/**
* Validate that required data for a given operation are available.
*/
bool BKE_lib_override_library_property_operation_operands_validate(
struct IDOverrideLibraryPropertyOperation *liboverride_property_operation,
struct PointerRNA *ptr_dst,
struct PointerRNA *ptr_src,
struct PointerRNA *ptr_storage,
struct PropertyRNA *prop_dst,
struct PropertyRNA *prop_src,
struct PropertyRNA *prop_storage);
IDOverrideLibraryPropertyOperation *liboverride_property_operation,
PointerRNA *ptr_dst,
PointerRNA *ptr_src,
PointerRNA *ptr_storage,
PropertyRNA *prop_dst,
PropertyRNA *prop_src,
PropertyRNA *prop_storage);
/**
* Check against potential \a bmain.
*/
void BKE_lib_override_library_validate(struct Main *bmain,
struct ID *id,
struct ReportList *reports);
void BKE_lib_override_library_validate(Main *bmain, ID *id, ReportList *reports);
/**
* Check against potential \a bmain.
*/
void BKE_lib_override_library_main_validate(struct Main *bmain, struct ReportList *reports);
void BKE_lib_override_library_main_validate(Main *bmain, ReportList *reports);
/**
* Check that status of local data-block is still valid against current reference one.
@@ -404,7 +399,7 @@ void BKE_lib_override_library_main_validate(struct Main *bmain, struct ReportLis
*
* \return true if status is OK, false otherwise.
*/
bool BKE_lib_override_library_status_check_local(struct Main *bmain, struct ID *local);
bool BKE_lib_override_library_status_check_local(Main *bmain, ID *local);
/**
* Check that status of reference data-block is still valid against current local one.
*
@@ -416,7 +411,7 @@ bool BKE_lib_override_library_status_check_local(struct Main *bmain, struct ID *
*
* \return true if status is OK, false otherwise.
*/
bool BKE_lib_override_library_status_check_reference(struct Main *bmain, struct ID *local);
bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local);
/**
* Compare local and reference data-blocks and create new override operations as needed,
@@ -432,15 +427,13 @@ bool BKE_lib_override_library_status_check_reference(struct Main *bmain, struct
* since it has to go over all properties in depth (all overridable ones at least).
* Generating differential values and applying overrides are much cheaper.
*/
void BKE_lib_override_library_operations_create(struct Main *bmain,
struct ID *local,
int *r_report_flags);
void BKE_lib_override_library_operations_create(Main *bmain, ID *local, int *r_report_flags);
/**
* Check all overrides from given \a bmain and create/update overriding operations as needed.
*
* \param r_report_flags: #eRNAOverrideMatchResult flags giving info about the result of this call.
*/
void BKE_lib_override_library_main_operations_create(struct Main *bmain,
void BKE_lib_override_library_main_operations_create(Main *bmain,
bool force_auto,
int *r_report_flags);
@@ -453,9 +446,7 @@ void BKE_lib_override_library_main_operations_create(struct Main *bmain,
* \note Typically used as part of BKE_lib_override_library_main_operations_create process, since
* modifying RNA properties from non-main threads is not safe.
*/
void BKE_lib_override_library_operations_restore(struct Main *bmain,
struct ID *local,
int *r_report_flags);
void BKE_lib_override_library_operations_restore(Main *bmain, ID *local, int *r_report_flags);
/**
* Restore forbidden modified override properties to the values of their matching properties in the
* linked reference ID, for all liboverride IDs tagged as needing such process in given `bmain`.
@@ -465,7 +456,7 @@ void BKE_lib_override_library_operations_restore(struct Main *bmain,
* \note Typically used as part of BKE_lib_override_library_main_operations_create process, since
* modifying RNA properties from non-main threads is not safe.
*/
void BKE_lib_override_library_main_operations_restore(struct Main *bmain, int *r_report_flags);
void BKE_lib_override_library_main_operations_restore(Main *bmain, int *r_report_flags);
/**
* Reset all overrides in given \a id_root, while preserving ID relations.
@@ -473,67 +464,66 @@ void BKE_lib_override_library_main_operations_restore(struct Main *bmain, int *r
* \param do_reset_system_override: If \a true, reset the given ID as a system override one (i.e.
* non-editable).
*/
void BKE_lib_override_library_id_reset(struct Main *bmain,
struct ID *id_root,
bool do_reset_system_override);
void BKE_lib_override_library_id_reset(Main *bmain, ID *id_root, bool do_reset_system_override);
/**
* Reset all overrides in given \a id_root and its dependencies, while preserving ID relations.
*
* \param do_reset_system_override: If \a true, reset the given ID and all of its descendants in
* the override hierarchy as system override ones (i.e. non-editable).
*/
void BKE_lib_override_library_id_hierarchy_reset(struct Main *bmain,
struct ID *id_root,
void BKE_lib_override_library_id_hierarchy_reset(Main *bmain,
ID *id_root,
bool do_reset_system_override);
/**
* Set or clear given tag in all operations in that override property data.
*/
void BKE_lib_override_library_operations_tag(
struct IDOverrideLibraryProperty *liboverride_property, short tag, bool do_set);
void BKE_lib_override_library_operations_tag(IDOverrideLibraryProperty *liboverride_property,
short tag,
bool do_set);
/**
* Set or clear given tag in all properties and operations in that override data.
*/
void BKE_lib_override_library_properties_tag(struct IDOverrideLibrary *liboverride,
void BKE_lib_override_library_properties_tag(IDOverrideLibrary *liboverride,
short tag,
bool do_set);
/**
* Set or clear given tag in all properties and operations in that Main's ID override data.
*/
void BKE_lib_override_library_main_tag(struct Main *bmain, short tag, bool do_set);
void BKE_lib_override_library_main_tag(Main *bmain, short tag, bool do_set);
/**
* Remove all tagged-as-unused properties and operations from that ID override data.
*/
void BKE_lib_override_library_id_unused_cleanup(struct ID *local);
void BKE_lib_override_library_id_unused_cleanup(ID *local);
/**
* Remove all tagged-as-unused properties and operations from that Main's ID override data.
*/
void BKE_lib_override_library_main_unused_cleanup(struct Main *bmain);
void BKE_lib_override_library_main_unused_cleanup(Main *bmain);
/**
* Update given override from its reference (re-applying overridden properties).
*/
void BKE_lib_override_library_update(struct Main *bmain, struct ID *local);
void BKE_lib_override_library_update(Main *bmain, ID *local);
/**
* Update all overrides from given \a bmain.
*/
void BKE_lib_override_library_main_update(struct Main *bmain);
void BKE_lib_override_library_main_update(Main *bmain);
/**
* In case an ID is used by another liboverride ID, user may not be allowed to delete it.
*/
bool BKE_lib_override_library_id_is_user_deletable(struct Main *bmain, struct ID *id);
bool BKE_lib_override_library_id_is_user_deletable(Main *bmain, ID *id);
/**
* Debugging helper to show content of given liboverride data.
*/
void BKE_lib_override_debug_print(struct IDOverrideLibrary *liboverride, const char *intro_txt);
void BKE_lib_override_debug_print(IDOverrideLibrary *liboverride, const char *intro_txt);
/* Storage (.blend file writing) part. */
/* For now, we just use a temp main list. */
typedef struct Main OverrideLibraryStorage;
using OverrideLibraryStorage = Main;
/**
* Initialize an override storage.
@@ -545,13 +535,14 @@ OverrideLibraryStorage *BKE_lib_override_library_operations_store_init(void);
* Note that \a local ID is no more modified by this call,
* all extra data are stored in its temp \a storage_id copy.
*/
struct ID *BKE_lib_override_library_operations_store_start(
struct Main *bmain, OverrideLibraryStorage *liboverride_storage, struct ID *local);
ID *BKE_lib_override_library_operations_store_start(Main *bmain,
OverrideLibraryStorage *liboverride_storage,
ID *local);
/**
* Restore given ID modified by #BKE_lib_override_library_operations_store_start, to its
* original state.
*/
void BKE_lib_override_library_operations_store_end(OverrideLibraryStorage *liboverride_storage,
struct ID *local);
ID *local);
void BKE_lib_override_library_operations_store_finalize(
OverrideLibraryStorage *liboverride_storage);

View File

@@ -12,28 +12,29 @@
#include "BLI_utildefines.h"
struct BMesh;
struct Mesh;
/* Mesh Fairing. */
/* Creates a smooth as possible geometry patch in a defined area. Different values of depth allow
* to minimize changes in the vertex positions or tangency in the affected area. */
typedef enum eMeshFairingDepth {
enum eMeshFairingDepth {
MESH_FAIRING_DEPTH_POSITION = 1,
MESH_FAIRING_DEPTH_TANGENCY = 2,
} eMeshFairingDepth;
};
/**
* Affect_vertices is used to define the fairing area. Indexed by vertex index, set to true when
* the vertex should be modified by fairing.
*/
void BKE_bmesh_prefair_and_fair_verts(struct BMesh *bm,
bool *affect_verts,
eMeshFairingDepth depth);
void BKE_bmesh_prefair_and_fair_verts(BMesh *bm, bool *affect_verts, eMeshFairingDepth depth);
/**
* This function can optionally use the vertex coordinates of deform_mverts to read and write the
* fairing result. When NULL, the function will use mesh positions directly.
*/
void BKE_mesh_prefair_and_fair_verts(struct Mesh *mesh,
void BKE_mesh_prefair_and_fair_verts(Mesh *mesh,
float (*deform_vert_positions)[3],
bool *affect_verts,
eMeshFairingDepth depth);

View File

@@ -9,14 +9,14 @@
struct Mesh;
typedef enum MeshForeachFlag {
enum MeshForeachFlag {
MESH_FOREACH_NOP = 0,
/* foreachMappedVert, foreachMappedLoop, foreachMappedFaceCenter */
MESH_FOREACH_USE_NORMAL = (1 << 0),
} MeshForeachFlag;
};
void BKE_mesh_foreach_mapped_vert(
const struct Mesh *mesh,
const Mesh *mesh,
void (*func)(void *user_data, int index, const float co[3], const float no[3]),
void *user_data,
MeshForeachFlag flag);
@@ -26,11 +26,11 @@ void BKE_mesh_foreach_mapped_vert(
* edge indices.
*/
void BKE_mesh_foreach_mapped_edge(
struct Mesh *mesh,
Mesh *mesh,
int tot_edges,
void (*func)(void *user_data, int index, const float v0co[3], const float v1co[3]),
void *user_data);
void BKE_mesh_foreach_mapped_loop(struct Mesh *mesh,
void BKE_mesh_foreach_mapped_loop(Mesh *mesh,
void (*func)(void *user_data,
int vertex_index,
int face_index,
@@ -39,16 +39,14 @@ void BKE_mesh_foreach_mapped_loop(struct Mesh *mesh,
void *user_data,
MeshForeachFlag flag);
void BKE_mesh_foreach_mapped_face_center(
struct Mesh *mesh,
Mesh *mesh,
void (*func)(void *user_data, int index, const float cent[3], const float no[3]),
void *user_data,
MeshForeachFlag flag);
void BKE_mesh_foreach_mapped_subdiv_face_center(
struct Mesh *mesh,
Mesh *mesh,
void (*func)(void *user_data, int index, const float cent[3], const float no[3]),
void *user_data,
MeshForeachFlag flag);
void BKE_mesh_foreach_mapped_vert_coords_get(const struct Mesh *me_eval,
float (*r_cos)[3],
int totcos);
void BKE_mesh_foreach_mapped_vert_coords_get(const Mesh *me_eval, float (*r_cos)[3], int totcos);

View File

@@ -21,48 +21,48 @@ void BKE_mesh_legacy_convert_uvs_to_generic(Mesh *mesh);
/**
* Copy face sets to the generic data type from the legacy type.
*/
void BKE_mesh_legacy_face_set_to_generic(struct Mesh *mesh);
void BKE_mesh_legacy_face_set_to_generic(Mesh *mesh);
/**
* Copy edge creases from edges to a separate layer.
*/
void BKE_mesh_legacy_edge_crease_to_layers(struct Mesh *mesh);
void BKE_mesh_legacy_crease_to_generic(struct Mesh *mesh);
void BKE_mesh_legacy_edge_crease_to_layers(Mesh *mesh);
void BKE_mesh_legacy_crease_to_generic(Mesh *mesh);
/**
* Copy bevel weights from vertices and edges to separate layers.
*/
void BKE_mesh_legacy_bevel_weight_to_layers(struct Mesh *mesh);
void BKE_mesh_legacy_bevel_weight_to_layers(Mesh *mesh);
/**
* Move bevel weight to generic float attribute type.
*/
void BKE_mesh_legacy_bevel_weight_to_generic(struct Mesh *mesh);
void BKE_mesh_legacy_bevel_weight_to_generic(Mesh *mesh);
/**
* Convert the old hide flags (#ME_HIDE) to the hidden element attribute for reading.
* Only add the attributes when there are any elements in each domain hidden.
*/
void BKE_mesh_legacy_convert_flags_to_hide_layers(struct Mesh *mesh);
void BKE_mesh_legacy_convert_flags_to_hide_layers(Mesh *mesh);
/**
* Convert the old selection flags (#SELECT/#ME_FACE_SEL) to the selected element attribute for
* reading. Only add the attributes when there are any elements in each domain selected.
*/
void BKE_mesh_legacy_convert_flags_to_selection_layers(struct Mesh *mesh);
void BKE_mesh_legacy_convert_flags_to_selection_layers(Mesh *mesh);
/**
* Move material indices from the #MPoly struct to a generic attributes.
* Move material indices from the #MPoly to a generic attributes.
* Only add the attribute when the indices are not all zero.
*/
void BKE_mesh_legacy_convert_mpoly_to_material_indices(struct Mesh *mesh);
void BKE_mesh_legacy_convert_mpoly_to_material_indices(Mesh *mesh);
void BKE_mesh_legacy_attribute_flags_to_strings(struct Mesh *mesh);
void BKE_mesh_legacy_attribute_flags_to_strings(Mesh *mesh);
void BKE_mesh_legacy_sharp_faces_from_flags(struct Mesh *mesh);
void BKE_mesh_legacy_sharp_faces_from_flags(Mesh *mesh);
void BKE_mesh_legacy_sharp_edges_from_flags(struct Mesh *mesh);
void BKE_mesh_legacy_sharp_edges_from_flags(Mesh *mesh);
void BKE_mesh_legacy_uv_seam_from_flags(struct Mesh *mesh);
void BKE_mesh_legacy_uv_seam_from_flags(Mesh *mesh);
void BKE_mesh_legacy_convert_verts_to_positions(Mesh *mesh);
@@ -70,27 +70,24 @@ void BKE_mesh_legacy_convert_edges_to_generic(Mesh *mesh);
void BKE_mesh_legacy_convert_polys_to_offsets(Mesh *mesh);
void BKE_mesh_legacy_convert_loops_to_corners(struct Mesh *mesh);
void BKE_mesh_legacy_convert_loops_to_corners(Mesh *mesh);
void BKE_mesh_legacy_face_map_to_generic(struct Mesh *mesh);
void BKE_mesh_legacy_face_map_to_generic(Mesh *mesh);
/**
* Recreate #MFace Tessellation.
*/
void BKE_mesh_tessface_calc(struct Mesh *mesh);
void BKE_mesh_tessface_calc(Mesh *mesh);
void BKE_mesh_tessface_ensure(struct Mesh *mesh);
void BKE_mesh_tessface_ensure(Mesh *mesh);
/**
* Rotates the vertices of a face in case v[2] or v[3] (vertex index) is = 0.
* this is necessary to make the if #MFace.v4 check for quads work.
*/
int BKE_mesh_mface_index_validate(struct MFace *mface,
struct CustomData *mfdata,
int mfindex,
int nr);
int BKE_mesh_mface_index_validate(MFace *mface, CustomData *mfdata, int mfindex, int nr);
void BKE_mesh_convert_mfaces_to_mpolys(struct Mesh *mesh);
void BKE_mesh_convert_mfaces_to_mpolys(Mesh *mesh);
/**
* The same as #BKE_mesh_convert_mfaces_to_mpolys
@@ -98,18 +95,18 @@ void BKE_mesh_convert_mfaces_to_mpolys(struct Mesh *mesh);
* the difference is how active/render/clone/stencil indices are handled here.
*
* normally they're being set from `pdata` which totally makes sense for meshes which are
* already converted to #BMesh structures, but when loading older files indices shall be updated in
* already converted to #BMesh ures, but when loading older files indices shall be updated in
* other way around, so newly added `pdata` and `ldata` would have this indices set based on
* `pdata` layer.
*
* this is normally only needed when reading older files,
* in all other cases #BKE_mesh_convert_mfaces_to_mpolys shall be always used.
*/
void BKE_mesh_do_versions_convert_mfaces_to_mpolys(struct Mesh *mesh);
void BKE_mesh_do_versions_convert_mfaces_to_mpolys(Mesh *mesh);
void BKE_mesh_calc_edges_legacy(struct Mesh *me);
void BKE_mesh_calc_edges_legacy(Mesh *me);
void BKE_mesh_do_versions_cd_flag_init(struct Mesh *mesh);
void BKE_mesh_do_versions_cd_flag_init(Mesh *mesh);
/* Inlines */

View File

@@ -11,32 +11,34 @@
#include "BLI_math_vector_types.hh"
#include "BLI_offset_indices.hh"
struct BMLoop;
struct MemArena;
struct MLoopTri;
/* UvVertMap */
#define STD_UV_CONNECT_LIMIT 0.0001f
/* Map from uv vertex to face. Used by select linked, uv subdivision-surface and obj exporter. */
typedef struct UvVertMap {
struct UvMapVert **vert;
struct UvMapVert *buf;
} UvVertMap;
typedef struct UvMapVert {
struct UvMapVert *next;
struct UvMapVert {
UvMapVert *next;
unsigned int face_index;
unsigned short loop_of_face_index;
bool separate;
} UvMapVert;
};
/* Map from uv vertex to face. Used by select linked, uv subdivision-surface and obj exporter. */
struct UvVertMap {
UvMapVert **vert;
UvMapVert *buf;
};
/* UvElement stores per uv information so that we can quickly access information for a uv.
* it is actually an improved UvMapVert, including an island and a direct pointer to the face
* to avoid initializing face arrays */
typedef struct UvElement {
struct UvElement {
/* Next UvElement corresponding to same vertex */
struct UvElement *next;
UvElement *next;
/* Face the element belongs to */
struct BMLoop *l;
BMLoop *l;
/* index in loop. */
unsigned short loop_of_face_index;
/* Whether this element is the first of coincident elements */
@@ -45,7 +47,7 @@ typedef struct UvElement {
unsigned char flag;
/* If generating element map with island sorting, this stores the island index */
unsigned int island;
} UvElement;
};
/**
* UvElementMap is a container for UvElements of a BMesh.
@@ -61,19 +63,19 @@ typedef struct UvElement {
* be `mutable`, as they are created on demand, and never
* changed after creation.
*/
typedef struct UvElementMap {
struct UvElementMap {
/** UvElement Storage. */
struct UvElement *storage;
UvElement *storage;
/** Total number of UVs. */
int total_uvs;
/** Total number of unique UVs. */
int total_unique_uvs;
/** If Non-NULL, address UvElements by `BM_elem_index_get(BMVert*)`. */
struct UvElement **vertex;
UvElement **vertex;
/** If Non-NULL, pointer to local head of each unique UV. */
struct UvElement **head_table;
UvElement **head_table;
/** If Non-NULL, pointer to index of each unique UV. */
int *unique_index_table;
@@ -86,13 +88,13 @@ typedef struct UvElementMap {
int *island_total_uvs;
/** Array of number of unique UVs in each island. */
int *island_total_unique_uvs;
} UvElementMap;
};
/* Connectivity data */
typedef struct MeshElemMap {
struct MeshElemMap {
int *indices;
int count;
} MeshElemMap;
};
/* mapping */
@@ -117,7 +119,7 @@ void BKE_mesh_uv_vert_map_free(UvVertMap *vmap);
void BKE_mesh_vert_looptri_map_create(MeshElemMap **r_map,
int **r_mem,
int totvert,
const struct MLoopTri *mlooptri,
const MLoopTri *mlooptri,
int totlooptri,
const int *corner_verts,
int totloop);
@@ -158,7 +160,7 @@ enum {
MISLAND_TYPE_LOOP = 4,
};
typedef struct MeshIslandStore {
struct MeshIslandStore {
short item_type; /* MISLAND_TYPE_... */
short island_type; /* MISLAND_TYPE_... */
short innercut_type; /* MISLAND_TYPE_... */
@@ -168,11 +170,11 @@ typedef struct MeshIslandStore {
int islands_num;
size_t islands_num_alloc;
struct MeshElemMap **islands; /* Array of pointers, one item per island. */
struct MeshElemMap **innercuts; /* Array of pointers, one item per island. */
MeshElemMap **islands; /* Array of pointers, one item per island. */
MeshElemMap **innercuts; /* Array of pointers, one item per island. */
struct MemArena *mem; /* Memory arena, internal use only. */
} MeshIslandStore;
MemArena *mem; /* Memory arena, internal use only. */
};
void BKE_mesh_loop_islands_init(MeshIslandStore *island_store,
short item_type,
@@ -189,16 +191,16 @@ void BKE_mesh_loop_islands_add(MeshIslandStore *island_store,
int num_innercut_items,
int *innercut_item_indices);
typedef bool (*MeshRemapIslandsCalc)(const float (*vert_positions)[3],
int totvert,
const blender::int2 *edges,
int totedge,
const bool *uv_seams,
blender::OffsetIndices<int> faces,
const int *corner_verts,
const int *corner_edges,
int totloop,
struct MeshIslandStore *r_island_store);
using MeshRemapIslandsCalc = bool (*)(const float (*vert_positions)[3],
int totvert,
const blender::int2 *edges,
int totedge,
const bool *uv_seams,
blender::OffsetIndices<int> faces,
const int *corner_verts,
const int *corner_edges,
int totloop,
MeshIslandStore *r_island_store);
/* Above vert/UV mapping stuff does not do what we need here, but does things we do not need here.
* So better keep them separated for now, I think. */

View File

@@ -13,25 +13,22 @@ struct Mesh;
struct MirrorModifierData;
struct Object;
struct Mesh *BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(struct MirrorModifierData *mmd,
const struct Mesh *mesh,
int axis,
const float plane_co[3],
float plane_no[3]);
Mesh *BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(MirrorModifierData *mmd,
const Mesh *mesh,
int axis,
const float plane_co[3],
float plane_no[3]);
void BKE_mesh_mirror_apply_mirror_on_axis(struct Main *bmain,
struct Mesh *mesh,
int axis,
float dist);
void BKE_mesh_mirror_apply_mirror_on_axis(Main *bmain, Mesh *mesh, int axis, float dist);
/**
* \warning This should _not_ be used to modify original meshes since
* it doesn't handle shape-keys, use #BKE_mesh_mirror_apply_mirror_on_axis instead.
*/
struct Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(struct MirrorModifierData *mmd,
struct Object *ob,
const struct Mesh *mesh,
int axis,
bool use_correct_order_on_merge,
int **r_vert_merge_map,
int *r_vert_merge_map_len);
Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd,
Object *ob,
const Mesh *mesh,
int axis,
bool use_correct_order_on_merge,
int **r_vert_merge_map,
int *r_vert_merge_map_len);

View File

@@ -20,22 +20,22 @@ struct Mesh;
/* Generic ways to map some geometry elements from a source mesh to a destination one. */
typedef struct MeshPairRemapItem {
struct MeshPairRemapItem {
int sources_num;
int *indices_src; /* NULL if no source found. */
float *weights_src; /* NULL if no source found, else, always normalized! */
/* UNUSED (at the moment). */
// float hit_dist; /* FLT_MAX if irrelevant or no source found. */
int island; /* For loops only. */
} MeshPairRemapItem;
};
/* All mapping computing func return this. */
typedef struct MeshPairRemap {
struct MeshPairRemap {
int items_num;
MeshPairRemapItem *items; /* Array, one item per destination element. */
struct MemArena *mem; /* memory arena, internal use only. */
} MeshPairRemap;
};
/* Helpers! */
void BKE_mesh_remap_init(MeshPairRemap *map, int items_num);
@@ -143,11 +143,7 @@ enum {
};
void BKE_mesh_remap_calc_source_cddata_masks_from_map_modes(
int vert_mode,
int edge_mode,
int loop_mode,
int face_mode,
struct CustomData_MeshMasks *cddata_mask);
int vert_mode, int edge_mode, int loop_mode, int face_mode, CustomData_MeshMasks *cddata_mask);
/**
* Compute a value of the difference between both given meshes.
@@ -159,32 +155,32 @@ void BKE_mesh_remap_calc_source_cddata_masks_from_map_modes(
* the same weight in final result, which allows to reduce influence of a few high differences,
* in favor of a global good matching.
*/
float BKE_mesh_remap_calc_difference_from_mesh(const struct SpaceTransform *space_transform,
float BKE_mesh_remap_calc_difference_from_mesh(const SpaceTransform *space_transform,
const float (*vert_positions_dst)[3],
int numverts_dst,
const struct Mesh *me_src);
const Mesh *me_src);
/**
* Set r_space_transform so that best bbox of dst matches best bbox of src.
*/
void BKE_mesh_remap_find_best_match_from_mesh(const float (*vert_positions_dst)[3],
int numverts_dst,
const struct Mesh *me_src,
struct SpaceTransform *r_space_transform);
const Mesh *me_src,
SpaceTransform *r_space_transform);
void BKE_mesh_remap_calc_verts_from_mesh(int mode,
const struct SpaceTransform *space_transform,
const SpaceTransform *space_transform,
float max_dist,
float ray_radius,
const float (*vert_positions_dst)[3],
int numverts_dst,
bool dirty_nors_dst,
const struct Mesh *me_src,
struct Mesh *me_dst,
const Mesh *me_src,
Mesh *me_dst,
MeshPairRemap *r_map);
void BKE_mesh_remap_calc_edges_from_mesh(int mode,
const struct SpaceTransform *space_transform,
const SpaceTransform *space_transform,
float max_dist,
float ray_radius,
const float (*vert_positions_dst)[3],
@@ -192,15 +188,15 @@ void BKE_mesh_remap_calc_edges_from_mesh(int mode,
const blender::int2 *edges_dst,
int numedges_dst,
bool dirty_nors_dst,
const struct Mesh *me_src,
struct Mesh *me_dst,
const Mesh *me_src,
Mesh *me_dst,
MeshPairRemap *r_map);
void BKE_mesh_remap_calc_loops_from_mesh(int mode,
const struct SpaceTransform *space_transform,
const SpaceTransform *space_transform,
float max_dist,
float ray_radius,
struct Mesh *mesh_dst,
Mesh *mesh_dst,
const float (*vert_positions_dst)[3],
int numverts_dst,
const blender::int2 *edges_dst,
@@ -209,23 +205,23 @@ void BKE_mesh_remap_calc_loops_from_mesh(int mode,
const int *corner_edges_dst,
int numloops_dst,
const blender::OffsetIndices<int> faces_dst,
struct CustomData *ldata_dst,
CustomData *ldata_dst,
bool use_split_nors_dst,
float split_angle_dst,
bool dirty_nors_dst,
const struct Mesh *me_src,
const Mesh *me_src,
MeshRemapIslandsCalc gen_islands_src,
float islands_precision_src,
struct MeshPairRemap *r_map);
MeshPairRemap *r_map);
void BKE_mesh_remap_calc_faces_from_mesh(int mode,
const struct SpaceTransform *space_transform,
const SpaceTransform *space_transform,
float max_dist,
float ray_radius,
const struct Mesh *mesh_dst,
const Mesh *mesh_dst,
const float (*vert_positions_dst)[3],
int numverts_dst,
const int *corner_verts,
const blender::OffsetIndices<int> faces_dst,
const struct Mesh *me_src,
struct MeshPairRemap *r_map);
const Mesh *me_src,
MeshPairRemap *r_map);

View File

@@ -10,21 +10,18 @@
struct Mesh;
struct Mesh *BKE_mesh_remesh_voxel_fix_poles(const struct Mesh *mesh);
struct Mesh *BKE_mesh_remesh_voxel(const struct Mesh *mesh,
float voxel_size,
float adaptivity,
float isovalue);
struct Mesh *BKE_mesh_remesh_quadriflow(const struct Mesh *mesh,
int target_faces,
int seed,
bool preserve_sharp,
bool preserve_boundary,
bool adaptive_scale,
void (*update_cb)(void *, float progress, int *cancel),
void *update_cb_data);
Mesh *BKE_mesh_remesh_voxel_fix_poles(const Mesh *mesh);
Mesh *BKE_mesh_remesh_voxel(const Mesh *mesh, float voxel_size, float adaptivity, float isovalue);
Mesh *BKE_mesh_remesh_quadriflow(const Mesh *mesh,
int target_faces,
int seed,
bool preserve_sharp,
bool preserve_boundary,
bool adaptive_scale,
void (*update_cb)(void *, float progress, int *cancel),
void *update_cb_data);
/* Data reprojection functions */
void BKE_mesh_remesh_reproject_paint_mask(struct Mesh *target, const struct Mesh *source);
void BKE_remesh_reproject_vertex_paint(struct Mesh *target, const struct Mesh *source);
void BKE_remesh_reproject_sculpt_face_sets(struct Mesh *target, const struct Mesh *source);
void BKE_mesh_remesh_reproject_paint_mask(Mesh *target, const Mesh *source);
void BKE_remesh_reproject_vertex_paint(Mesh *target, const Mesh *source);
void BKE_remesh_reproject_sculpt_face_sets(Mesh *target, const Mesh *source);

View File

@@ -21,11 +21,11 @@ struct Object;
struct Scene;
/** Return the number of derived triangles (looptris). */
int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh);
int BKE_mesh_runtime_looptri_len(const Mesh *mesh);
const int *BKE_mesh_runtime_looptri_faces_ensure(const struct Mesh *mesh);
const int *BKE_mesh_runtime_looptri_faces_ensure(const Mesh *mesh);
bool BKE_mesh_runtime_ensure_edit_data(struct Mesh *mesh);
bool BKE_mesh_runtime_ensure_edit_data(Mesh *mesh);
/**
* Clear and free any derived caches associated with the mesh geometry data. Examples include BVH
@@ -38,7 +38,7 @@ bool BKE_mesh_runtime_ensure_edit_data(struct Mesh *mesh);
* Also note that some derived caches like #CD_NORMAL and #CD_TANGENT are stored directly in
* #CustomData.
*/
void BKE_mesh_runtime_clear_geometry(struct Mesh *mesh);
void BKE_mesh_runtime_clear_geometry(Mesh *mesh);
/**
* Similar to #BKE_mesh_runtime_clear_geometry, but subtly different in that it also clears
@@ -46,49 +46,47 @@ void BKE_mesh_runtime_clear_geometry(struct Mesh *mesh);
* functionally the same in most cases, but prefer this function if unsure, since it clears
* more data.
*/
void BKE_mesh_runtime_clear_cache(struct Mesh *mesh);
void BKE_mesh_runtime_clear_cache(Mesh *mesh);
/**
* Convert triangles encoded as face corner indices to triangles encoded as vertex indices.
*/
void BKE_mesh_runtime_verttri_from_looptri(struct MVertTri *r_verttri,
void BKE_mesh_runtime_verttri_from_looptri(MVertTri *r_verttri,
const int *corner_verts,
const struct MLoopTri *looptri,
const MLoopTri *looptri,
int looptri_num);
/** \note Only used for access in C. */
bool BKE_mesh_is_deformed_only(const struct Mesh *mesh);
bool BKE_mesh_is_deformed_only(const Mesh *mesh);
/** \note Only used for access in C. */
eMeshWrapperType BKE_mesh_wrapper_type(const struct Mesh *mesh);
eMeshWrapperType BKE_mesh_wrapper_type(const Mesh *mesh);
/* NOTE: the functions below are defined in DerivedMesh.cc, and are intended to be moved
* to a more suitable location when that file is removed.
* They should also be renamed to use conventions from BKE, not old DerivedMesh.cc.
* For now keep the names similar to avoid confusion. */
struct Mesh *mesh_get_eval_deform(struct Depsgraph *depsgraph,
const struct Scene *scene,
struct Object *ob,
const struct CustomData_MeshMasks *dataMask);
Mesh *mesh_get_eval_deform(Depsgraph *depsgraph,
const Scene *scene,
Object *ob,
const CustomData_MeshMasks *dataMask);
struct Mesh *mesh_create_eval_final(struct Depsgraph *depsgraph,
const struct Scene *scene,
struct Object *ob,
const struct CustomData_MeshMasks *dataMask);
Mesh *mesh_create_eval_final(Depsgraph *depsgraph,
const Scene *scene,
Object *ob,
const CustomData_MeshMasks *dataMask);
struct Mesh *mesh_create_eval_no_deform(struct Depsgraph *depsgraph,
const struct Scene *scene,
struct Object *ob,
const struct CustomData_MeshMasks *dataMask);
struct Mesh *mesh_create_eval_no_deform_render(struct Depsgraph *depsgraph,
const struct Scene *scene,
struct Object *ob,
const struct CustomData_MeshMasks *dataMask);
Mesh *mesh_create_eval_no_deform(Depsgraph *depsgraph,
const Scene *scene,
Object *ob,
const CustomData_MeshMasks *dataMask);
Mesh *mesh_create_eval_no_deform_render(Depsgraph *depsgraph,
const Scene *scene,
Object *ob,
const CustomData_MeshMasks *dataMask);
void BKE_mesh_runtime_eval_to_meshkey(struct Mesh *me_deformed,
struct Mesh *me,
struct KeyBlock *kb);
void BKE_mesh_runtime_eval_to_meshkey(Mesh *me_deformed, Mesh *me, KeyBlock *kb);
#ifndef NDEBUG
bool BKE_mesh_runtime_is_valid(struct Mesh *me_eval);
bool BKE_mesh_runtime_is_valid(Mesh *me_eval);
#endif /* NDEBUG */

View File

@@ -29,7 +29,7 @@ void BKE_mesh_calc_loop_tangent_single_ex(const float (*vert_positions)[3],
const float (*loopuv)[2],
int numLoops,
blender::OffsetIndices<int> faces,
struct ReportList *reports);
ReportList *reports);
/**
* Wrapper around BKE_mesh_calc_loop_tangent_single_ex, which takes care of most boilerplate code.
@@ -37,10 +37,10 @@ void BKE_mesh_calc_loop_tangent_single_ex(const float (*vert_positions)[3],
* - There must be a valid loop's CD_NORMALS available.
* - The mesh should be made of only triangles and quads!
*/
void BKE_mesh_calc_loop_tangent_single(struct Mesh *mesh,
void BKE_mesh_calc_loop_tangent_single(Mesh *mesh,
const char *uvmap,
float (*r_looptangents)[4],
struct ReportList *reports);
ReportList *reports);
/**
* See: #BKE_editmesh_loop_tangent_calc (matching logic).
@@ -48,12 +48,12 @@ void BKE_mesh_calc_loop_tangent_single(struct Mesh *mesh,
void BKE_mesh_calc_loop_tangent_ex(const float (*vert_positions)[3],
blender::OffsetIndices<int> faces,
const int *corner_verts,
const struct MLoopTri *looptri,
const MLoopTri *looptri,
const int *looptri_faces,
uint looptri_len,
const bool *sharp_faces,
struct CustomData *loopdata,
CustomData *loopdata,
bool calc_active_tangent,
const char (*tangent_names)[MAX_CUSTOMDATA_LAYER_NAME],
int tangent_names_len,
@@ -62,18 +62,18 @@ void BKE_mesh_calc_loop_tangent_ex(const float (*vert_positions)[3],
const float (*loop_normals)[3],
const float (*vert_orco)[3],
/* result */
struct CustomData *loopdata_out,
CustomData *loopdata_out,
uint loopdata_out_len,
short *tangent_mask_curr_p);
void BKE_mesh_calc_loop_tangents(struct Mesh *me_eval,
void BKE_mesh_calc_loop_tangents(Mesh *me_eval,
bool calc_active_tangent,
const char (*tangent_names)[MAX_CUSTOMDATA_LAYER_NAME],
int tangent_names_len);
/* Helpers */
void BKE_mesh_add_loop_tangent_named_layer_for_uv(struct CustomData *uv_data,
struct CustomData *tan_data,
void BKE_mesh_add_loop_tangent_named_layer_for_uv(CustomData *uv_data,
CustomData *tan_data,
int numLoopData,
const char *layer_name);
@@ -84,7 +84,7 @@ void BKE_mesh_add_loop_tangent_named_layer_for_uv(struct CustomData *uv_data,
* Also, we calculate tangent_mask that works as a descriptor of tangents state.
* If tangent_mask has changed, then recalculate tangents.
*/
void BKE_mesh_calc_loop_tangent_step_0(const struct CustomData *loopData,
void BKE_mesh_calc_loop_tangent_step_0(const CustomData *loopData,
bool calc_active_tangent,
const char (*tangent_names)[MAX_CUSTOMDATA_LAYER_NAME],
int tangent_names_count,

View File

@@ -32,14 +32,14 @@ struct EditMeshData;
}
/** #MeshRuntime.wrapper_type */
typedef enum eMeshWrapperType {
enum eMeshWrapperType {
/** Use mesh data (#Mesh.vert_positions(), #Mesh.medge, #Mesh.corner_verts(), #Mesh.faces()). */
ME_WRAPPER_TYPE_MDATA = 0,
/** Use edit-mesh data (#Mesh.edit_mesh, #MeshRuntime.edit_data). */
ME_WRAPPER_TYPE_BMESH = 1,
/** Use subdivision mesh data (#MeshRuntime.mesh_eval). */
ME_WRAPPER_TYPE_SUBD = 2,
} eMeshWrapperType;
};
namespace blender::bke {

View File

@@ -11,37 +11,37 @@ struct BMEditMesh;
struct CustomData_MeshMasks;
struct Mesh;
struct Mesh *BKE_mesh_wrapper_from_editmesh(struct BMEditMesh *em,
const struct CustomData_MeshMasks *cd_mask_extra,
const struct Mesh *me_settings);
void BKE_mesh_wrapper_ensure_mdata(struct Mesh *me);
bool BKE_mesh_wrapper_minmax(const struct Mesh *me, float min[3], float max[3]);
Mesh *BKE_mesh_wrapper_from_editmesh(BMEditMesh *em,
const CustomData_MeshMasks *cd_mask_extra,
const Mesh *me_settings);
void BKE_mesh_wrapper_ensure_mdata(Mesh *me);
bool BKE_mesh_wrapper_minmax(const Mesh *me, float min[3], float max[3]);
int BKE_mesh_wrapper_vert_len(const struct Mesh *me);
int BKE_mesh_wrapper_edge_len(const struct Mesh *me);
int BKE_mesh_wrapper_loop_len(const struct Mesh *me);
int BKE_mesh_wrapper_face_len(const struct Mesh *me);
int BKE_mesh_wrapper_vert_len(const Mesh *me);
int BKE_mesh_wrapper_edge_len(const Mesh *me);
int BKE_mesh_wrapper_loop_len(const Mesh *me);
int BKE_mesh_wrapper_face_len(const Mesh *me);
/**
* Return a contiguous array of vertex position values, if available.
* Otherwise, vertex positions are stored in BMesh vertices.
*/
const float (*BKE_mesh_wrapper_vert_coords(const struct Mesh *mesh))[3];
const float (*BKE_mesh_wrapper_vert_coords(const Mesh *mesh))[3];
/**
* Return a contiguous array of face normal values, if available.
* Otherwise, normals are stored in BMesh faces.
*/
const float (*BKE_mesh_wrapper_face_normals(struct Mesh *mesh))[3];
const float (*BKE_mesh_wrapper_face_normals(Mesh *mesh))[3];
void BKE_mesh_wrapper_tag_positions_changed(struct Mesh *mesh);
void BKE_mesh_wrapper_tag_positions_changed(Mesh *mesh);
void BKE_mesh_wrapper_vert_coords_copy(const struct Mesh *me,
void BKE_mesh_wrapper_vert_coords_copy(const Mesh *me,
float (*vert_coords)[3],
int vert_coords_len);
void BKE_mesh_wrapper_vert_coords_copy_with_mat4(const struct Mesh *me,
void BKE_mesh_wrapper_vert_coords_copy_with_mat4(const Mesh *me,
float (*vert_coords)[3],
int vert_coords_len,
const float mat[4][4]);
struct Mesh *BKE_mesh_wrapper_ensure_subdivision(struct Mesh *me);
Mesh *BKE_mesh_wrapper_ensure_subdivision(Mesh *me);

View File

@@ -16,121 +16,105 @@ struct DerivedMesh;
struct MDisps;
struct Mesh;
struct ModifierData;
struct MLoopTri;
struct MultiresModifierData;
struct Object;
struct Scene;
struct SubdivCCG;
struct MLoopTri;
struct SubdivSettings;
struct SubdivToMeshSettings;
/**
* Delete mesh mdisps and grid paint masks.
*/
void multires_customdata_delete(struct Mesh *me);
void multires_customdata_delete(Mesh *me);
void multires_set_tot_level(struct Object *ob, struct MultiresModifierData *mmd, int lvl);
void multires_set_tot_level(Object *ob, MultiresModifierData *mmd, int lvl);
void multires_mark_as_modified(struct Depsgraph *depsgraph,
struct Object *object,
enum MultiresModifiedFlags flags);
void multires_mark_as_modified(Depsgraph *depsgraph, Object *object, MultiresModifiedFlags flags);
void multires_flush_sculpt_updates(struct Object *object);
void multires_force_sculpt_rebuild(struct Object *object);
void multires_force_external_reload(struct Object *object);
void multires_flush_sculpt_updates(Object *object);
void multires_force_sculpt_rebuild(Object *object);
void multires_force_external_reload(Object *object);
/* internal, only called in subsurf_ccg.cc */
void multires_modifier_update_mdisps(struct DerivedMesh *dm, struct Scene *scene);
void multires_modifier_update_hidden(struct DerivedMesh *dm);
void multires_modifier_update_mdisps(DerivedMesh *dm, Scene *scene);
void multires_modifier_update_hidden(DerivedMesh *dm);
/**
* Reset the multi-res levels to match the number of mdisps.
*/
void multiresModifier_set_levels_from_disps(struct MultiresModifierData *mmd, struct Object *ob);
void multiresModifier_set_levels_from_disps(MultiresModifierData *mmd, Object *ob);
typedef enum MultiresFlags {
enum MultiresFlags {
MULTIRES_USE_LOCAL_MMD = 1,
MULTIRES_USE_RENDER_PARAMS = 2,
MULTIRES_ALLOC_PAINT_MASK = 4,
MULTIRES_IGNORE_SIMPLIFY = 8,
} MultiresFlags;
};
ENUM_OPERATORS(MultiresFlags, MULTIRES_IGNORE_SIMPLIFY);
struct DerivedMesh *multires_make_derived_from_derived(struct DerivedMesh *dm,
struct MultiresModifierData *mmd,
struct Scene *scene,
struct Object *ob,
MultiresFlags flags);
DerivedMesh *multires_make_derived_from_derived(
DerivedMesh *dm, MultiresModifierData *mmd, Scene *scene, Object *ob, MultiresFlags flags);
struct MultiresModifierData *find_multires_modifier_before(struct Scene *scene,
struct ModifierData *lastmd);
MultiresModifierData *find_multires_modifier_before(Scene *scene, ModifierData *lastmd);
/**
* used for applying scale on mdisps layer and syncing subdivide levels when joining objects.
* \param use_first: return first multi-res modifier if all multi-res'es are disabled.
*/
struct MultiresModifierData *get_multires_modifier(struct Scene *scene,
struct Object *ob,
bool use_first);
int multires_get_level(const struct Scene *scene,
const struct Object *ob,
const struct MultiresModifierData *mmd,
MultiresModifierData *get_multires_modifier(Scene *scene, Object *ob, bool use_first);
int multires_get_level(const Scene *scene,
const Object *ob,
const MultiresModifierData *mmd,
bool render,
bool ignore_simplify);
/**
* Creates mesh with multi-res modifier applied on current object's deform mesh.
*/
struct Mesh *BKE_multires_create_mesh(struct Depsgraph *depsgraph,
struct Object *object,
struct MultiresModifierData *mmd);
Mesh *BKE_multires_create_mesh(Depsgraph *depsgraph, Object *object, MultiresModifierData *mmd);
/**
* Get coordinates of a deformed base mesh which is an input to the given multi-res modifier.
* \note The modifiers will be re-evaluated.
*/
float (*BKE_multires_create_deformed_base_mesh_vert_coords(struct Depsgraph *depsgraph,
struct Object *object,
struct MultiresModifierData *mmd,
float (*BKE_multires_create_deformed_base_mesh_vert_coords(Depsgraph *depsgraph,
Object *object,
MultiresModifierData *mmd,
int *r_num_deformed_verts))[3];
/**
* \param direction: 1 for delete higher, 0 for lower (not implemented yet).
*/
void multiresModifier_del_levels(struct MultiresModifierData *mmd,
struct Scene *scene,
struct Object *object,
void multiresModifier_del_levels(MultiresModifierData *mmd,
Scene *scene,
Object *object,
int direction);
void multiresModifier_base_apply(struct Depsgraph *depsgraph,
struct Object *object,
struct MultiresModifierData *mmd);
int multiresModifier_rebuild_subdiv(struct Depsgraph *depsgraph,
struct Object *object,
struct MultiresModifierData *mmd,
void multiresModifier_base_apply(Depsgraph *depsgraph, Object *object, MultiresModifierData *mmd);
int multiresModifier_rebuild_subdiv(Depsgraph *depsgraph,
Object *object,
MultiresModifierData *mmd,
int rebuild_limit,
bool switch_view_to_lower_level);
/**
* If `ob_src` and `ob_dst` both have multi-res modifiers,
* synchronize them such that `ob_dst` has the same total number of levels as `ob_src`.
*/
void multiresModifier_sync_levels_ex(struct Object *ob_dst,
struct MultiresModifierData *mmd_src,
struct MultiresModifierData *mmd_dst);
void multiresModifier_sync_levels_ex(Object *ob_dst,
MultiresModifierData *mmd_src,
MultiresModifierData *mmd_dst);
void multires_stitch_grids(struct Object *);
void multires_stitch_grids(Object *);
void multiresModifier_scale_disp(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob);
void multiresModifier_prepare_join(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
struct Object *to_ob);
void multiresModifier_scale_disp(Depsgraph *depsgraph, Scene *scene, Object *ob);
void multiresModifier_prepare_join(Depsgraph *depsgraph, Scene *scene, Object *ob, Object *to_ob);
int multires_mdisp_corners(const struct MDisps *s);
int multires_mdisp_corners(const MDisps *s);
/**
* Update multi-res data after topology changing.
*/
void multires_topology_changed(struct Mesh *me);
void multires_topology_changed(Mesh *me);
/**
* Makes sure data from an external file is fully read.
@@ -139,9 +123,8 @@ void multires_topology_changed(struct Mesh *me);
* subdivision level some extra work is needed. Namely make is to all displacement grids have
* proper level and number of displacement vectors set.
*/
void multires_ensure_external_read(struct Mesh *mesh, int top_level);
void multiresModifier_ensure_external_read(struct Mesh *mesh,
const struct MultiresModifierData *mmd);
void multires_ensure_external_read(Mesh *mesh, int top_level);
void multiresModifier_ensure_external_read(Mesh *mesh, const MultiresModifierData *mmd);
/**** interpolation stuff ****/
/* Adapted from `sculptmode.c` */
@@ -154,9 +137,9 @@ int mdisp_rot_face_to_crn(int face_size, int face_side, float u, float v, float
/* Reshaping, define in multires_reshape.cc */
bool multiresModifier_reshapeFromVertcos(struct Depsgraph *depsgraph,
struct Object *object,
struct MultiresModifierData *mmd,
bool multiresModifier_reshapeFromVertcos(Depsgraph *depsgraph,
Object *object,
MultiresModifierData *mmd,
const float (*vert_coords)[3],
int num_vert_coords);
/**
@@ -165,54 +148,48 @@ bool multiresModifier_reshapeFromVertcos(struct Depsgraph *depsgraph,
* This function might fail in cases like source and destination not having
* matched amount of vertices.
*/
bool multiresModifier_reshapeFromObject(struct Depsgraph *depsgraph,
struct MultiresModifierData *mmd,
struct Object *dst,
struct Object *src);
bool multiresModifier_reshapeFromDeformModifier(struct Depsgraph *depsgraph,
struct Object *ob,
struct MultiresModifierData *mmd,
struct ModifierData *deform_md);
bool multiresModifier_reshapeFromCCG(int tot_level,
struct Mesh *coarse_mesh,
struct SubdivCCG *subdiv_ccg);
bool multiresModifier_reshapeFromObject(Depsgraph *depsgraph,
MultiresModifierData *mmd,
Object *dst,
Object *src);
bool multiresModifier_reshapeFromDeformModifier(Depsgraph *depsgraph,
Object *ob,
MultiresModifierData *mmd,
ModifierData *deform_md);
bool multiresModifier_reshapeFromCCG(int tot_level, Mesh *coarse_mesh, SubdivCCG *subdiv_ccg);
/* Subdivide multi-res displacement once. */
typedef enum eMultiresSubdivideModeType {
enum eMultiresSubdivideModeType {
MULTIRES_SUBDIVIDE_CATMULL_CLARK,
MULTIRES_SUBDIVIDE_SIMPLE,
MULTIRES_SUBDIVIDE_LINEAR,
} eMultiresSubdivideModeType;
};
void multiresModifier_subdivide(struct Object *object,
struct MultiresModifierData *mmd,
void multiresModifier_subdivide(Object *object,
MultiresModifierData *mmd,
eMultiresSubdivideModeType mode);
void multires_subdivide_create_tangent_displacement_linear_grids(struct Object *object,
struct MultiresModifierData *mmd);
void multires_subdivide_create_tangent_displacement_linear_grids(Object *object,
MultiresModifierData *mmd);
/**
* Subdivide displacement to the given level.
* If level is lower than the current top level nothing happens.
*/
void multiresModifier_subdivide_to_level(struct Object *object,
struct MultiresModifierData *mmd,
void multiresModifier_subdivide_to_level(Object *object,
MultiresModifierData *mmd,
int top_level,
eMultiresSubdivideModeType mode);
/* Subdivision integration, defined in multires_subdiv.cc */
struct SubdivSettings;
struct SubdivToMeshSettings;
void BKE_multires_subdiv_settings_init(struct SubdivSettings *settings,
const struct MultiresModifierData *mmd);
void BKE_multires_subdiv_settings_init(SubdivSettings *settings, const MultiresModifierData *mmd);
/* TODO(sergey): Replace this set of boolean flags with bitmask. */
void BKE_multires_subdiv_mesh_settings_init(struct SubdivToMeshSettings *mesh_settings,
const struct Scene *scene,
const struct Object *object,
const struct MultiresModifierData *mmd,
void BKE_multires_subdiv_mesh_settings_init(SubdivToMeshSettings *mesh_settings,
const Scene *scene,
const Object *object,
const MultiresModifierData *mmd,
bool use_render_params,
bool ignore_simplify,
bool ignore_control_edges);
@@ -236,7 +213,6 @@ BLI_INLINE void BKE_multires_construct_tangent_matrix(float tangent_matrix[3][3]
* Convert displacement which is stored for simply-subdivided mesh to a Catmull-Clark
* subdivided mesh.
*/
void multires_do_versions_simple_to_catmull_clark(struct Object *object,
struct MultiresModifierData *mmd);
void multires_do_versions_simple_to_catmull_clark(Object *object, MultiresModifierData *mmd);
#include "intern/multires_inline.hh"

View File

@@ -33,15 +33,22 @@ struct CurveMapping;
struct Depsgraph;
struct EdgeSet;
struct EnumPropertyItem;
struct ExpandCache;
struct FilterCache;
struct GHash;
struct GridPaintMask;
struct Image;
struct ImagePool;
struct ImageUser;
struct KeyBlock;
struct ListBase;
struct MLoopTri;
struct Main;
struct Mesh;
struct MDeformVert;
struct MLoopCol;
struct MPropCol;
struct MultiresModifierData;
struct Object;
struct PBVH;
struct Paint;
@@ -70,7 +77,7 @@ extern const uchar PAINT_CURSOR_WEIGHT_PAINT[3];
extern const uchar PAINT_CURSOR_TEXTURE_PAINT[3];
extern const uchar PAINT_CURSOR_SCULPT_CURVES[3];
typedef enum ePaintMode {
enum ePaintMode {
PAINT_MODE_SCULPT = 0,
/** Vertex color. */
PAINT_MODE_VERTEX = 1,
@@ -90,19 +97,19 @@ typedef enum ePaintMode {
/** Keep last. */
PAINT_MODE_INVALID = 11,
} ePaintMode;
};
#define PAINT_MODE_HAS_BRUSH(mode) !ELEM(mode, PAINT_MODE_SCULPT_UV)
/* overlay invalidation */
typedef enum ePaintOverlayControlFlags {
enum ePaintOverlayControlFlags {
PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY = 1,
PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY = (1 << 2),
PAINT_OVERLAY_INVALID_CURVE = (1 << 3),
PAINT_OVERLAY_OVERRIDE_CURSOR = (1 << 4),
PAINT_OVERLAY_OVERRIDE_PRIMARY = (1 << 5),
PAINT_OVERLAY_OVERRIDE_SECONDARY = (1 << 6),
} ePaintOverlayControlFlags;
};
ENUM_OPERATORS(ePaintOverlayControlFlags, PAINT_OVERLAY_OVERRIDE_SECONDARY);
#define PAINT_OVERRIDE_MASK \
@@ -116,21 +123,17 @@ ENUM_OPERATORS(ePaintOverlayControlFlags, PAINT_OVERLAY_OVERRIDE_SECONDARY);
*/
#define PAINT_SYMM_AREA_DEFAULT 0
typedef enum ePaintSymmetryAreas {
enum ePaintSymmetryAreas {
PAINT_SYMM_AREA_X = (1 << 0),
PAINT_SYMM_AREA_Y = (1 << 1),
PAINT_SYMM_AREA_Z = (1 << 2),
} ePaintSymmetryAreas;
};
ENUM_OPERATORS(ePaintSymmetryAreas, PAINT_SYMM_AREA_Z);
#define PAINT_SYMM_AREAS 8
void BKE_paint_invalidate_overlay_tex(struct Scene *scene,
struct ViewLayer *view_layer,
const struct Tex *tex);
void BKE_paint_invalidate_cursor_overlay(struct Scene *scene,
struct ViewLayer *view_layer,
struct CurveMapping *curve);
void BKE_paint_invalidate_overlay_tex(Scene *scene, ViewLayer *view_layer, const Tex *tex);
void BKE_paint_invalidate_cursor_overlay(Scene *scene, ViewLayer *view_layer, CurveMapping *curve);
void BKE_paint_invalidate_overlay_all(void);
ePaintOverlayControlFlags BKE_paint_get_overlay_flags(void);
void BKE_paint_reset_overlay_invalid(ePaintOverlayControlFlags flag);
@@ -138,82 +141,79 @@ void BKE_paint_set_overlay_override(enum eOverlayFlags flag);
/* Palettes. */
struct Palette *BKE_palette_add(struct Main *bmain, const char *name);
struct PaletteColor *BKE_palette_color_add(struct Palette *palette);
bool BKE_palette_is_empty(const struct Palette *palette);
Palette *BKE_palette_add(Main *bmain, const char *name);
PaletteColor *BKE_palette_color_add(Palette *palette);
bool BKE_palette_is_empty(const Palette *palette);
/**
* Remove color from palette. Must be certain color is inside the palette!
*/
void BKE_palette_color_remove(struct Palette *palette, struct PaletteColor *color);
void BKE_palette_clear(struct Palette *palette);
void BKE_palette_color_remove(Palette *palette, PaletteColor *color);
void BKE_palette_clear(Palette *palette);
void BKE_palette_sort_hsv(struct tPaletteColorHSV *color_array, int totcol);
void BKE_palette_sort_svh(struct tPaletteColorHSV *color_array, int totcol);
void BKE_palette_sort_vhs(struct tPaletteColorHSV *color_array, int totcol);
void BKE_palette_sort_luminance(struct tPaletteColorHSV *color_array, int totcol);
bool BKE_palette_from_hash(struct Main *bmain,
struct GHash *color_table,
const char *name,
bool linear);
void BKE_palette_sort_hsv(tPaletteColorHSV *color_array, int totcol);
void BKE_palette_sort_svh(tPaletteColorHSV *color_array, int totcol);
void BKE_palette_sort_vhs(tPaletteColorHSV *color_array, int totcol);
void BKE_palette_sort_luminance(tPaletteColorHSV *color_array, int totcol);
bool BKE_palette_from_hash(Main *bmain, GHash *color_table, const char *name, bool linear);
/* Paint curves. */
struct PaintCurve *BKE_paint_curve_add(struct Main *bmain, const char *name);
PaintCurve *BKE_paint_curve_add(Main *bmain, const char *name);
/**
* Call when entering each respective paint mode.
*/
bool BKE_paint_ensure(struct ToolSettings *ts, struct Paint **r_paint);
void BKE_paint_init(struct Main *bmain, struct Scene *sce, ePaintMode mode, const uchar col[3]);
void BKE_paint_free(struct Paint *p);
bool BKE_paint_ensure(ToolSettings *ts, Paint **r_paint);
void BKE_paint_init(Main *bmain, Scene *sce, ePaintMode mode, const uchar col[3]);
void BKE_paint_free(Paint *p);
/**
* Called when copying scene settings, so even if 'src' and 'tar' are the same still do a
* #id_us_plus(), rather than if we were copying between 2 existing scenes where a matching
* value should decrease the existing user count as with #paint_brush_set()
*/
void BKE_paint_copy(struct Paint *src, struct Paint *tar, int flag);
void BKE_paint_copy(Paint *src, Paint *tar, int flag);
void BKE_paint_runtime_init(const struct ToolSettings *ts, struct Paint *paint);
void BKE_paint_runtime_init(const ToolSettings *ts, Paint *paint);
void BKE_paint_cavity_curve_preset(struct Paint *p, int preset);
void BKE_paint_cavity_curve_preset(Paint *p, int preset);
eObjectMode BKE_paint_object_mode_from_paintmode(ePaintMode mode);
bool BKE_paint_ensure_from_paintmode(struct Scene *sce, ePaintMode mode);
struct Paint *BKE_paint_get_active_from_paintmode(struct Scene *sce, ePaintMode mode);
const struct EnumPropertyItem *BKE_paint_get_tool_enum_from_paintmode(ePaintMode mode);
bool BKE_paint_ensure_from_paintmode(Scene *sce, ePaintMode mode);
Paint *BKE_paint_get_active_from_paintmode(Scene *sce, ePaintMode mode);
const EnumPropertyItem *BKE_paint_get_tool_enum_from_paintmode(ePaintMode mode);
const char *BKE_paint_get_tool_enum_translation_context_from_paintmode(ePaintMode mode);
const char *BKE_paint_get_tool_prop_id_from_paintmode(ePaintMode mode);
uint BKE_paint_get_brush_tool_offset_from_paintmode(ePaintMode mode);
struct Paint *BKE_paint_get_active(struct Scene *sce, struct ViewLayer *view_layer);
struct Paint *BKE_paint_get_active_from_context(const struct bContext *C);
ePaintMode BKE_paintmode_get_active_from_context(const struct bContext *C);
ePaintMode BKE_paintmode_get_from_tool(const struct bToolRef *tref);
struct Brush *BKE_paint_brush(struct Paint *paint);
const struct Brush *BKE_paint_brush_for_read(const struct Paint *p);
void BKE_paint_brush_set(struct Paint *paint, struct Brush *br);
struct Palette *BKE_paint_palette(struct Paint *paint);
void BKE_paint_palette_set(struct Paint *p, struct Palette *palette);
void BKE_paint_curve_set(struct Brush *br, struct PaintCurve *pc);
void BKE_paint_curve_clamp_endpoint_add_index(struct PaintCurve *pc, int add_index);
Paint *BKE_paint_get_active(Scene *sce, ViewLayer *view_layer);
Paint *BKE_paint_get_active_from_context(const bContext *C);
ePaintMode BKE_paintmode_get_active_from_context(const bContext *C);
ePaintMode BKE_paintmode_get_from_tool(const bToolRef *tref);
Brush *BKE_paint_brush(Paint *paint);
const Brush *BKE_paint_brush_for_read(const Paint *p);
void BKE_paint_brush_set(Paint *paint, Brush *br);
Palette *BKE_paint_palette(Paint *paint);
void BKE_paint_palette_set(Paint *p, Palette *palette);
void BKE_paint_curve_set(Brush *br, PaintCurve *pc);
void BKE_paint_curve_clamp_endpoint_add_index(PaintCurve *pc, int add_index);
/**
* Return true when in vertex/weight/texture paint + face-select mode?
*/
bool BKE_paint_select_face_test(struct Object *ob);
bool BKE_paint_select_face_test(Object *ob);
/**
* Return true when in vertex/weight paint + vertex-select mode?
*/
bool BKE_paint_select_vert_test(struct Object *ob);
bool BKE_paint_select_vert_test(Object *ob);
/**
* used to check if selection is possible
* (when we don't care if its face or vert)
*/
bool BKE_paint_select_elem_test(struct Object *ob);
bool BKE_paint_select_elem_test(Object *ob);
/**
* Checks if face/vertex hiding is always applied in the current mode.
* Returns true in vertex/weight paint.
*/
bool BKE_paint_always_hide_test(struct Object *ob);
bool BKE_paint_always_hide_test(Object *ob);
/* Partial visibility. */
@@ -229,49 +229,43 @@ bool paint_is_grid_face_hidden(const unsigned int *grid_hidden, int gridsize, in
/**
* Return true if all vertices in the face are visible, false otherwise.
*/
bool paint_is_bmesh_face_hidden(struct BMFace *f);
bool paint_is_bmesh_face_hidden(BMFace *f);
/* Paint masks. */
float paint_grid_paint_mask(const struct GridPaintMask *gpm, uint level, uint x, uint y);
float paint_grid_paint_mask(const GridPaintMask *gpm, uint level, uint x, uint y);
void BKE_paint_face_set_overlay_color_get(int face_set, int seed, uchar r_color[4]);
/* Stroke related. */
bool paint_calculate_rake_rotation(struct UnifiedPaintSettings *ups,
struct Brush *brush,
bool paint_calculate_rake_rotation(UnifiedPaintSettings *ups,
Brush *brush,
const float mouse_pos[2],
ePaintMode paint_mode,
bool stroke_has_started);
void paint_update_brush_rake_rotation(struct UnifiedPaintSettings *ups,
struct Brush *brush,
float rotation);
void paint_update_brush_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, float rotation);
void BKE_paint_stroke_get_average(struct Scene *scene, struct Object *ob, float stroke[3]);
void BKE_paint_stroke_get_average(Scene *scene, Object *ob, float stroke[3]);
/* Tool slot API. */
void BKE_paint_toolslots_init_from_main(struct Main *bmain);
void BKE_paint_toolslots_len_ensure(struct Paint *paint, int len);
void BKE_paint_toolslots_brush_update_ex(struct Paint *paint, struct Brush *brush);
void BKE_paint_toolslots_brush_update(struct Paint *paint);
void BKE_paint_toolslots_init_from_main(Main *bmain);
void BKE_paint_toolslots_len_ensure(Paint *paint, int len);
void BKE_paint_toolslots_brush_update_ex(Paint *paint, Brush *brush);
void BKE_paint_toolslots_brush_update(Paint *paint);
/**
* Run this to ensure brush types are set for each slot on entering modes
* (for new scenes for example).
*/
void BKE_paint_toolslots_brush_validate(struct Main *bmain, struct Paint *paint);
struct Brush *BKE_paint_toolslots_brush_get(struct Paint *paint, int slot_index);
void BKE_paint_toolslots_brush_validate(Main *bmain, Paint *paint);
Brush *BKE_paint_toolslots_brush_get(Paint *paint, int slot_index);
/* .blend I/O */
void BKE_paint_blend_write(struct BlendWriter *writer, struct Paint *paint);
void BKE_paint_blend_read_data(struct BlendDataReader *reader,
const struct Scene *scene,
struct Paint *paint);
void BKE_paint_blend_read_lib(struct BlendLibReader *reader,
struct Scene *scene,
struct Paint *paint);
void BKE_paint_blend_write(BlendWriter *writer, Paint *paint);
void BKE_paint_blend_read_data(BlendDataReader *reader, const Scene *scene, Paint *paint);
void BKE_paint_blend_read_lib(BlendLibReader *reader, Scene *scene, Paint *paint);
#define SCULPT_FACE_SET_NONE 0
@@ -287,7 +281,7 @@ struct SculptVertexPaintGeomMap {
};
/** Pose Brush IK Chain. */
typedef struct SculptPoseIKChainSegment {
struct SculptPoseIKChainSegment {
float orig[3];
float head[3];
@@ -303,18 +297,18 @@ typedef struct SculptPoseIKChainSegment {
float trans_mat[PAINT_SYMM_AREAS][4][4];
float pivot_mat[PAINT_SYMM_AREAS][4][4];
float pivot_mat_inv[PAINT_SYMM_AREAS][4][4];
} SculptPoseIKChainSegment;
};
typedef struct SculptPoseIKChain {
struct SculptPoseIKChain {
SculptPoseIKChainSegment *segments;
int tot_segments;
float grab_delta_offset[3];
} SculptPoseIKChain;
};
/* Cloth Brush */
/* Cloth Simulation. */
typedef enum eSculptClothNodeSimState {
enum eSculptClothNodeSimState {
/* Constraints were not built for this node, so it can't be simulated. */
SCULPT_CLOTH_NODE_UNINITIALIZED,
@@ -323,9 +317,9 @@ typedef enum eSculptClothNodeSimState {
/* There are constraints for this node and they should be used by the solver. */
SCULPT_CLOTH_NODE_ACTIVE,
} eSculptClothNodeSimState;
};
typedef enum eSculptClothConstraintType {
enum eSculptClothConstraintType {
/* Constraint that creates the structure of the cloth. */
SCULPT_CLOTH_CONSTRAINT_STRUCTURAL = 0,
/* Constraint that references the position of a vertex and a position in deformation_pos which
@@ -336,9 +330,9 @@ typedef enum eSculptClothConstraintType {
SCULPT_CLOTH_CONSTRAINT_SOFTBODY = 2,
/* Constraint that references the vertex position and its initial position. */
SCULPT_CLOTH_CONSTRAINT_PIN = 3,
} eSculptClothConstraintType;
};
typedef struct SculptClothLengthConstraint {
struct SculptClothLengthConstraint {
/* Elements that are affected by the constraint. */
/* Element a should always be a mesh vertex with the index stored in elem_index_a as it is always
* deformed. Element b could be another vertex of the same mesh or any other position (arbitrary
@@ -359,12 +353,12 @@ typedef struct SculptClothLengthConstraint {
int node;
eSculptClothConstraintType type;
} SculptClothLengthConstraint;
};
typedef struct SculptClothSimulation {
struct SculptClothSimulation {
SculptClothLengthConstraint *length_constraints;
int tot_length_constraints;
struct EdgeSet *created_length_constraints;
EdgeSet *created_length_constraints;
int capacity_length_constraints;
float *length_constraint_tweak;
@@ -386,26 +380,26 @@ typedef struct SculptClothSimulation {
float (*prev_pos)[3];
float (*last_iteration_pos)[3];
struct ListBase *collider_list;
ListBase *collider_list;
int totnode;
/** #PBVHNode pointer as a key, index in #SculptClothSimulation.node_state as value. */
struct GHash *node_state_index;
GHash *node_state_index;
eSculptClothNodeSimState *node_state;
} SculptClothSimulation;
};
typedef struct SculptPersistentBase {
struct SculptPersistentBase {
float co[3];
float no[3];
float disp;
} SculptPersistentBase;
};
typedef struct SculptVertexInfo {
struct SculptVertexInfo {
/* Indexed by base mesh vertex index, stores if that vertex is a boundary. */
BLI_bitmap *boundary;
} SculptVertexInfo;
};
typedef struct SculptBoundaryEditInfo {
struct SculptBoundaryEditInfo {
/* Vertex index from where the topology propagation reached this vertex. */
int original_vertex_i;
@@ -414,15 +408,15 @@ typedef struct SculptBoundaryEditInfo {
/* Strength that is used to deform this vertex. */
float strength_factor;
} SculptBoundaryEditInfo;
};
/* Edge for drawing the boundary preview in the cursor. */
typedef struct SculptBoundaryPreviewEdge {
struct SculptBoundaryPreviewEdge {
PBVHVertRef v1;
PBVHVertRef v2;
} SculptBoundaryPreviewEdge;
};
typedef struct SculptBoundary {
struct SculptBoundary {
/* Vertex indices of the active boundary. */
PBVHVertRef *verts;
int verts_capacity;
@@ -461,7 +455,7 @@ typedef struct SculptBoundary {
/* Indexed by vertex index, contains the topology information needed for boundary deformations.
*/
struct SculptBoundaryEditInfo *edit_info;
SculptBoundaryEditInfo *edit_info;
/* Bend Deform type. */
struct {
@@ -479,9 +473,9 @@ typedef struct SculptBoundary {
float rotation_axis[3];
float pivot_position[3];
} twist;
} SculptBoundary;
};
typedef struct SculptFakeNeighbors {
struct SculptFakeNeighbors {
bool use_fake_neighbors;
/* Max distance used to calculate neighborhood information. */
@@ -489,14 +483,13 @@ typedef struct SculptFakeNeighbors {
/* Indexed by vertex, stores the vertex index of its fake neighbor if available. */
int *fake_neighbor_index;
} SculptFakeNeighbors;
};
/* Session data (mode-specific) */
/* Custom Temporary Attributes */
typedef struct SculptAttributeParams {
struct SculptAttributeParams {
/* Allocate a flat array outside the CustomData system. Cannot be combined with permanent. */
int simple_array : 1;
@@ -505,16 +498,16 @@ typedef struct SculptAttributeParams {
*/
int permanent : 1; /* Cannot be combined with simple_array. */
int stroke_only : 1; /* Release layer at end of struct */
} SculptAttributeParams;
};
typedef struct SculptAttribute {
struct SculptAttribute {
/* Domain, data type and name */
eAttrDomain domain;
eCustomDataType proptype;
char name[MAX_CUSTOMDATA_LAYER_NAME];
/* Source layer on mesh/bmesh, if any. */
struct CustomDataLayer *layer;
CustomDataLayer *layer;
/* Data stored as flat array. */
void *data;
@@ -537,7 +530,7 @@ typedef struct SculptAttribute {
* inside of SculptSession.temp_attribute are used.
*/
bool used;
} SculptAttribute;
};
#define SCULPT_MAX_ATTRIBUTES 64
@@ -553,7 +546,7 @@ typedef struct SculptAttribute {
/* Convenience pointers for standard sculpt attributes. */
typedef struct SculptAttributePointers {
struct SculptAttributePointers {
/* Persistent base. */
SculptAttribute *persistent_co;
SculptAttribute *persistent_no;
@@ -571,18 +564,18 @@ typedef struct SculptAttributePointers {
/* BMesh */
SculptAttribute *dyntopo_node_id_vertex;
SculptAttribute *dyntopo_node_id_face;
} SculptAttributePointers;
};
typedef struct SculptSession {
struct SculptSession {
/* Mesh data (not copied) can come either directly from a Mesh, or from a MultiresDM */
struct { /* Special handling for multires meshes */
bool active;
struct MultiresModifierData *modifier;
MultiresModifierData *modifier;
int level;
} multires;
/* Depsgraph for the Cloth Brush solver to get the colliders. */
struct Depsgraph *depsgraph;
Depsgraph *depsgraph;
/* These are always assigned to base mesh data when using PBVH_FACES and PBVH_GRIDS. */
blender::MutableSpan<blender::float3> vert_positions;
@@ -592,9 +585,9 @@ typedef struct SculptSession {
/* These contain the vertex and poly counts of the final mesh. */
int totvert, faces_num;
struct KeyBlock *shapekey_active;
struct MPropCol *vcol;
struct MLoopCol *mcol;
KeyBlock *shapekey_active;
MPropCol *vcol;
MLoopCol *mcol;
eAttrDomain vcol_domain;
eCustomDataType vcol_type;
@@ -633,15 +626,15 @@ typedef struct SculptSession {
bool *hide_poly;
/* BMesh for dynamic topology sculpting */
struct BMesh *bm;
BMesh *bm;
/* Undo/redo log for dynamic topology sculpting */
struct BMLog *bm_log;
BMLog *bm_log;
/* Limit surface/grids. */
struct SubdivCCG *subdiv_ccg;
SubdivCCG *subdiv_ccg;
/* PBVH acceleration structure */
struct PBVH *pbvh;
PBVH *pbvh;
/* Painting on deformed mesh */
bool deform_modifiers_active; /* Object is deformed with some modifiers. */
@@ -650,11 +643,11 @@ typedef struct SculptSession {
float (*deform_imats)[3][3]; /* Crazy-space deformation matrices. */
/* Pool for texture evaluations. */
struct ImagePool *tex_pool;
ImagePool *tex_pool;
struct StrokeCache *cache;
struct FilterCache *filter_cache;
struct ExpandCache *expand_cache;
StrokeCache *cache;
FilterCache *filter_cache;
ExpandCache *expand_cache;
/* Cursor data and active vertex for tools */
PBVHVertRef active_vertex;
@@ -681,9 +674,9 @@ typedef struct SculptSession {
bool gesture_initial_hit;
/* TODO(jbakker): Replace rv3d and v3d with ViewContext */
struct RegionView3D *rv3d;
struct View3D *v3d;
struct Scene *scene;
RegionView3D *rv3d;
View3D *v3d;
Scene *scene;
/* Dynamic mesh preview */
PBVHVertRef *preview_vert_list;
@@ -714,17 +707,17 @@ typedef struct SculptSession {
struct {
struct {
struct SculptVertexPaintGeomMap gmap;
SculptVertexPaintGeomMap gmap;
} vpaint;
struct {
struct SculptVertexPaintGeomMap gmap;
SculptVertexPaintGeomMap gmap;
/* Keep track of how much each vertex has been painted (non-airbrush only). */
float *alpha_weight;
/* Needed to continuously re-apply over the same weights (BRUSH_ACCUMULATE disabled).
* Lazy initialize as needed (flag is set to 1 to tag it as uninitialized). */
struct MDeformVert *dvert_prev;
MDeformVert *dvert_prev;
} wpaint;
/* TODO: identify sculpt-only fields */
@@ -744,7 +737,7 @@ typedef struct SculptSession {
/* This is a fixed-size array so we can pass pointers to its elements
* to client code. This is important to keep bmesh offsets up to date.
*/
struct SculptAttribute temp_attributes[SCULPT_MAX_ATTRIBUTES];
SculptAttribute temp_attributes[SCULPT_MAX_ATTRIBUTES];
/* Convenience #SculptAttribute pointers. */
SculptAttributePointers attrs;
@@ -768,40 +761,40 @@ typedef struct SculptSession {
int last_automasking_settings_hash;
uchar last_automask_stroke_id;
bool islands_valid; /* Is attrs.topology_island_key valid? */
} SculptSession;
};
void BKE_sculptsession_free(struct Object *ob);
void BKE_sculptsession_free_deformMats(struct SculptSession *ss);
void BKE_sculptsession_free_vwpaint_data(struct SculptSession *ss);
void BKE_sculptsession_bm_to_me(struct Object *ob, bool reorder);
void BKE_sculptsession_bm_to_me_for_render(struct Object *object);
int BKE_sculptsession_vertex_count(const struct SculptSession *ss);
void BKE_sculptsession_free(Object *ob);
void BKE_sculptsession_free_deformMats(SculptSession *ss);
void BKE_sculptsession_free_vwpaint_data(SculptSession *ss);
void BKE_sculptsession_bm_to_me(Object *ob, bool reorder);
void BKE_sculptsession_bm_to_me_for_render(Object *object);
int BKE_sculptsession_vertex_count(const SculptSession *ss);
/* Ensure an attribute layer exists. */
SculptAttribute *BKE_sculpt_attribute_ensure(struct Object *ob,
SculptAttribute *BKE_sculpt_attribute_ensure(Object *ob,
eAttrDomain domain,
eCustomDataType proptype,
const char *name,
const SculptAttributeParams *params);
/* Returns nullptr if attribute does not exist. */
SculptAttribute *BKE_sculpt_attribute_get(struct Object *ob,
SculptAttribute *BKE_sculpt_attribute_get(Object *ob,
eAttrDomain domain,
eCustomDataType proptype,
const char *name);
bool BKE_sculpt_attribute_exists(struct Object *ob,
bool BKE_sculpt_attribute_exists(Object *ob,
eAttrDomain domain,
eCustomDataType proptype,
const char *name);
bool BKE_sculpt_attribute_destroy(struct Object *ob, SculptAttribute *attr);
bool BKE_sculpt_attribute_destroy(Object *ob, SculptAttribute *attr);
/* Destroy all attributes and pseudo-attributes created by sculpt mode. */
void BKE_sculpt_attribute_destroy_temporary_all(struct Object *ob);
void BKE_sculpt_attribute_destroy_temporary_all(Object *ob);
/* Destroy attributes that were marked as stroke only in SculptAttributeParams. */
void BKE_sculpt_attributes_destroy_temporary_stroke(struct Object *ob);
void BKE_sculpt_attributes_destroy_temporary_stroke(Object *ob);
BLI_INLINE void *BKE_sculpt_vertex_attr_get(const PBVHVertRef vertex, const SculptAttribute *attr)
{
@@ -849,32 +842,28 @@ BLI_INLINE void *BKE_sculpt_face_attr_get(const PBVHFaceRef vertex, const Sculpt
* Create new color layer on object if it doesn't have one and if experimental feature set has
* sculpt vertex color enabled. Returns truth if new layer has been added, false otherwise.
*/
void BKE_sculpt_color_layer_create_if_needed(struct Object *object);
void BKE_sculpt_color_layer_create_if_needed(Object *object);
/**
* \warning Expects a fully evaluated depsgraph.
*/
void BKE_sculpt_update_object_for_edit(struct Depsgraph *depsgraph,
struct Object *ob_orig,
bool need_pmap,
bool need_mask,
bool is_paint_tool);
void BKE_sculpt_update_object_before_eval(struct Object *ob_eval);
void BKE_sculpt_update_object_after_eval(struct Depsgraph *depsgraph, struct Object *ob_eval);
void BKE_sculpt_update_object_for_edit(
Depsgraph *depsgraph, Object *ob_orig, bool need_pmap, bool need_mask, bool is_paint_tool);
void BKE_sculpt_update_object_before_eval(Object *ob_eval);
void BKE_sculpt_update_object_after_eval(Depsgraph *depsgraph, Object *ob_eval);
/**
* Sculpt mode handles multi-res differently from regular meshes, but only if
* it's the last modifier on the stack and it is not on the first level.
*/
struct MultiresModifierData *BKE_sculpt_multires_active(const struct Scene *scene,
struct Object *ob);
int *BKE_sculpt_face_sets_ensure(struct Object *ob);
MultiresModifierData *BKE_sculpt_multires_active(const Scene *scene, Object *ob);
int *BKE_sculpt_face_sets_ensure(Object *ob);
/**
* Create the attribute used to store face visibility and retrieve its data.
* Note that changes to the face visibility have to be propagated to other domains
* (see #SCULPT_visibility_sync_all_from_faces).
*/
bool *BKE_sculpt_hide_poly_ensure(struct Mesh *mesh);
bool *BKE_sculpt_hide_poly_ensure(Mesh *mesh);
/**
* Ensures a mask layer exists. If depsgraph and bmain are non-null,
@@ -884,24 +873,24 @@ bool *BKE_sculpt_hide_poly_ensure(struct Mesh *mesh);
*
* \note always call *before* #BKE_sculpt_update_object_for_edit.
*/
int BKE_sculpt_mask_layers_ensure(struct Depsgraph *depsgraph,
struct Main *bmain,
struct Object *ob,
struct MultiresModifierData *mmd);
void BKE_sculpt_toolsettings_data_ensure(struct Scene *scene);
int BKE_sculpt_mask_layers_ensure(Depsgraph *depsgraph,
Main *bmain,
Object *ob,
MultiresModifierData *mmd);
void BKE_sculpt_toolsettings_data_ensure(Scene *scene);
struct PBVH *BKE_sculpt_object_pbvh_ensure(struct Depsgraph *depsgraph, struct Object *ob);
PBVH *BKE_sculpt_object_pbvh_ensure(Depsgraph *depsgraph, Object *ob);
void BKE_sculpt_bvh_update_from_ccg(struct PBVH *pbvh, struct SubdivCCG *subdiv_ccg);
void BKE_sculpt_bvh_update_from_ccg(PBVH *pbvh, SubdivCCG *subdiv_ccg);
void BKE_sculpt_ensure_orig_mesh_data(struct Scene *scene, struct Object *object);
void BKE_sculpt_sync_face_visibility_to_grids(struct Mesh *mesh, struct SubdivCCG *subdiv_ccg);
void BKE_sculpt_ensure_orig_mesh_data(Scene *scene, Object *object);
void BKE_sculpt_sync_face_visibility_to_grids(Mesh *mesh, SubdivCCG *subdiv_ccg);
/**
* Test if PBVH can be used directly for drawing, which is faster than
* drawing the mesh and all updates that come with it.
*/
bool BKE_sculptsession_use_pbvh_draw(const struct Object *ob, const struct RegionView3D *rv3d);
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d);
enum {
SCULPT_MASK_LAYER_CALC_VERT = (1 << 0),
@@ -919,13 +908,13 @@ enum {
*
* \return #true if successful.
*/
bool BKE_object_attributes_active_color_fill(struct Object *ob,
bool BKE_object_attributes_active_color_fill(Object *ob,
const float fill_color[4],
bool only_selected);
/** C accessor for #Object::sculpt::pbvh. */
struct PBVH *BKE_object_sculpt_pbvh_get(struct Object *object);
bool BKE_object_sculpt_use_dyntopo(const struct Object *object);
PBVH *BKE_object_sculpt_pbvh_get(Object *object);
bool BKE_object_sculpt_use_dyntopo(const Object *object);
/* paint_canvas.cc */
@@ -933,13 +922,12 @@ bool BKE_object_sculpt_use_dyntopo(const struct Object *object);
* Create a key that can be used to compare with previous ones to identify changes.
* The resulting 'string' is owned by the caller.
*/
char *BKE_paint_canvas_key_get(struct PaintModeSettings *settings, struct Object *ob);
char *BKE_paint_canvas_key_get(PaintModeSettings *settings, Object *ob);
bool BKE_paint_canvas_image_get(struct PaintModeSettings *settings,
struct Object *ob,
struct Image **r_image,
struct ImageUser **r_image_user);
int BKE_paint_canvas_uvmap_layer_index_get(const struct PaintModeSettings *settings,
struct Object *ob);
void BKE_sculpt_check_cavity_curves(struct Sculpt *sd);
struct CurveMapping *BKE_sculpt_default_cavity_curve(void);
bool BKE_paint_canvas_image_get(PaintModeSettings *settings,
Object *ob,
Image **r_image,
ImageUser **r_image_user);
int BKE_paint_canvas_uvmap_layer_index_get(const PaintModeSettings *settings, Object *ob);
void BKE_sculpt_check_cavity_curves(Sculpt *sd);
CurveMapping *BKE_sculpt_default_cavity_curve(void);

View File

@@ -18,25 +18,25 @@ struct OpenSubdiv_Evaluator;
struct OpenSubdiv_TopologyRefiner;
struct Subdiv;
typedef enum eSubdivVtxBoundaryInterpolation {
enum eSubdivVtxBoundaryInterpolation {
/* Do not interpolate boundaries. */
SUBDIV_VTX_BOUNDARY_NONE,
/* Sharpen edges. */
SUBDIV_VTX_BOUNDARY_EDGE_ONLY,
/* sharpen edges and corners, */
SUBDIV_VTX_BOUNDARY_EDGE_AND_CORNER,
} eSubdivVtxBoundaryInterpolation;
};
typedef enum eSubdivFVarLinearInterpolation {
enum eSubdivFVarLinearInterpolation {
SUBDIV_FVAR_LINEAR_INTERPOLATION_NONE,
SUBDIV_FVAR_LINEAR_INTERPOLATION_CORNERS_ONLY,
SUBDIV_FVAR_LINEAR_INTERPOLATION_CORNERS_AND_JUNCTIONS,
SUBDIV_FVAR_LINEAR_INTERPOLATION_CORNERS_JUNCTIONS_AND_CONCAVE,
SUBDIV_FVAR_LINEAR_INTERPOLATION_BOUNDARIES,
SUBDIV_FVAR_LINEAR_INTERPOLATION_ALL,
} eSubdivFVarLinearInterpolation;
};
typedef struct SubdivSettings {
struct SubdivSettings {
/* Simple subdivision corresponds to "Simple" option in the interface. When it's enabled the
* subdivided mesh is not "smoothed": new vertices are added uniformly on the existing surface.
*
@@ -66,10 +66,10 @@ typedef struct SubdivSettings {
eSubdivVtxBoundaryInterpolation vtx_boundary_interpolation;
eSubdivFVarLinearInterpolation fvar_linear_interpolation;
} SubdivSettings;
};
/* NOTE: Order of enumerators MUST match order of values in SubdivStats. */
typedef enum eSubdivStatsValue {
enum eSubdivStatsValue {
SUBDIV_STATS_TOPOLOGY_REFINER_CREATION_TIME = 0,
SUBDIV_STATS_SUBDIV_TO_MESH,
SUBDIV_STATS_SUBDIV_TO_MESH_GEOMETRY,
@@ -80,9 +80,9 @@ typedef enum eSubdivStatsValue {
SUBDIV_STATS_TOPOLOGY_COMPARE,
NUM_SUBDIV_STATS_VALUES,
} eSubdivStatsValue;
};
typedef struct SubdivStats {
struct SubdivStats {
union {
struct {
/* Time spent on creating topology refiner, which includes time
@@ -110,16 +110,16 @@ typedef struct SubdivStats {
/* Per-value timestamp on when corresponding BKE_subdiv_stats_begin() was
* called. */
double begin_timestamp_[NUM_SUBDIV_STATS_VALUES];
} SubdivStats;
};
/* Functor which evaluates displacement at a given (u, v) of given ptex face. */
typedef struct SubdivDisplacement {
struct SubdivDisplacement {
/* Initialize displacement evaluator.
*
* Is called right before evaluation is actually needed. This allows to do
* some lazy initialization, like allocate evaluator from a main thread but
* then do actual evaluation from background job. */
void (*initialize)(struct SubdivDisplacement *displacement);
void (*initialize)(SubdivDisplacement *displacement);
/* Return displacement which is to be added to the original coordinate.
*
@@ -131,7 +131,7 @@ typedef struct SubdivDisplacement {
*
* Averaging of displacement for vertices created for over coarse vertices
* and edges is done by subdiv code. */
void (*eval_displacement)(struct SubdivDisplacement *displacement,
void (*eval_displacement)(SubdivDisplacement *displacement,
int ptex_face_index,
float u,
float v,
@@ -140,17 +140,17 @@ typedef struct SubdivDisplacement {
float r_D[3]);
/* Free the data, not the evaluator itself. */
void (*free)(struct SubdivDisplacement *displacement);
void (*free)(SubdivDisplacement *displacement);
void *user_data;
} SubdivDisplacement;
};
/* This structure contains everything needed to construct subdivided surface.
* It does not specify storage, memory layout or anything else.
* It is possible to create different storage's (like, grid based CPU side
* buffers, GPU subdivision mesh, CPU side fully qualified mesh) from the same
* Subdiv structure. */
typedef struct Subdiv {
struct Subdiv {
/* Settings this subdivision surface is created for.
*
* It is read-only after assignment in BKE_subdiv_new_from_FOO(). */
@@ -158,11 +158,11 @@ typedef struct Subdiv {
/* Topology refiner includes all the glue logic to feed Blender side
* topology to OpenSubdiv. It can be shared by both evaluator and GL mesh
* drawer. */
struct OpenSubdiv_TopologyRefiner *topology_refiner;
OpenSubdiv_TopologyRefiner *topology_refiner;
/* CPU side evaluator. */
struct OpenSubdiv_Evaluator *evaluator;
OpenSubdiv_Evaluator *evaluator;
/* Optional displacement evaluator. */
struct SubdivDisplacement *displacement_evaluator;
SubdivDisplacement *displacement_evaluator;
/* Statistics for debugging. */
SubdivStats stats;
@@ -181,15 +181,15 @@ typedef struct Subdiv {
*/
int *face_ptex_offset;
} cache_;
} Subdiv;
};
/* --------------------------------------------------------------------
* Module.
*/
/* (De)initialize the entire subdivision surface module. */
void BKE_subdiv_init(void);
void BKE_subdiv_exit(void);
void BKE_subdiv_init();
void BKE_subdiv_exit();
/* --------------------------------------------------------------------
* Conversion helpers.

View File

@@ -26,45 +26,44 @@ struct Subdiv;
*/
/* Functor which evaluates mask value at a given (u, v) of given ptex face. */
typedef struct SubdivCCGMaskEvaluator {
float (*eval_mask)(struct SubdivCCGMaskEvaluator *mask_evaluator,
struct SubdivCCGMaskEvaluator {
float (*eval_mask)(SubdivCCGMaskEvaluator *mask_evaluator,
int ptex_face_index,
float u,
float v);
/* Free the data, not the evaluator itself. */
void (*free)(struct SubdivCCGMaskEvaluator *mask_evaluator);
void (*free)(SubdivCCGMaskEvaluator *mask_evaluator);
void *user_data;
} SubdivCCGMaskEvaluator;
};
/* Return true if mesh has mask and evaluator can be used. */
bool BKE_subdiv_ccg_mask_init_from_paint(SubdivCCGMaskEvaluator *mask_evaluator,
const struct Mesh *mesh);
bool BKE_subdiv_ccg_mask_init_from_paint(SubdivCCGMaskEvaluator *mask_evaluator, const Mesh *mesh);
/* --------------------------------------------------------------------
* Materials.
*/
/* Functor which evaluates material and flags of a given coarse face. */
typedef struct SubdivCCGMaterialFlagsEvaluator {
DMFlagMat (*eval_material_flags)(
struct SubdivCCGMaterialFlagsEvaluator *material_flags_evaluator, int coarse_face_index);
struct SubdivCCGMaterialFlagsEvaluator {
DMFlagMat (*eval_material_flags)(SubdivCCGMaterialFlagsEvaluator *material_flags_evaluator,
int coarse_face_index);
/* Free the data, not the evaluator itself. */
void (*free)(struct SubdivCCGMaterialFlagsEvaluator *material_flags_evaluator);
void (*free)(SubdivCCGMaterialFlagsEvaluator *material_flags_evaluator);
void *user_data;
} SubdivCCGMaterialFlagsEvaluator;
};
void BKE_subdiv_ccg_material_flags_init_from_mesh(
SubdivCCGMaterialFlagsEvaluator *material_flags_evaluator, const struct Mesh *mesh);
SubdivCCGMaterialFlagsEvaluator *material_flags_evaluator, const Mesh *mesh);
/* --------------------------------------------------------------------
* SubdivCCG.
*/
typedef struct SubdivToCCGSettings {
struct SubdivToCCGSettings {
/* Resolution at which regular ptex (created for quad face) are being
* evaluated. This defines how many vertices final mesh will have: every
* regular ptex has resolution^2 vertices. Special (irregular, or ptex
@@ -74,18 +73,18 @@ typedef struct SubdivToCCGSettings {
/* Denotes which extra layers to be added to CCG elements. */
bool need_normal;
bool need_mask;
} SubdivToCCGSettings;
};
typedef struct SubdivCCGCoord {
struct SubdivCCGCoord {
/* Index of the grid within SubdivCCG::grids array. */
int grid_index;
/* Coordinate within the grid. */
short x, y;
} SubdivCCGCoord;
};
/* This is actually a coarse face, which consists of multiple CCG grids. */
typedef struct SubdivCCGFace {
struct SubdivCCGFace {
/* Total number of grids in this face.
*
* This 1:1 corresponds to a number of corners (or loops) from a coarse
@@ -93,30 +92,30 @@ typedef struct SubdivCCGFace {
int num_grids;
/* Index of first grid from this face in SubdivCCG->grids array. */
int start_grid_index;
} SubdivCCGFace;
};
/* Definition of an edge which is adjacent to at least one of the faces. */
typedef struct SubdivCCGAdjacentEdge {
struct SubdivCCGAdjacentEdge {
int num_adjacent_faces;
/* Indexed by adjacent face index, then by point index on the edge.
* points to a coordinate into the grids. */
struct SubdivCCGCoord **boundary_coords;
} SubdivCCGAdjacentEdge;
};
/* Definition of a vertex which is adjacent to at least one of the faces. */
typedef struct SubdivCCGAdjacentVertex {
struct SubdivCCGAdjacentVertex {
int num_adjacent_faces;
/* Indexed by adjacent face index, points to a coordinate in the grids. */
struct SubdivCCGCoord *corner_coords;
} SubdivCCGAdjacentVertex;
};
/* Representation of subdivision surface which uses CCG grids. */
typedef struct SubdivCCG {
struct SubdivCCG {
/* This is a subdivision surface this CCG was created for.
*
* TODO(sergey): Make sure the whole descriptor is valid, including all the
* displacement attached to the surface. */
struct Subdiv *subdiv;
Subdiv *subdiv;
/* A level at which geometry was subdivided. This is what defines grid
* resolution. It is NOT the topology refinement level. */
int level;
@@ -132,18 +131,18 @@ typedef struct SubdivCCG {
*/
/* Indexed by a grid index, points to a grid data which is stored in
* grids_storage. */
struct CCGElem **grids;
CCGElem **grids;
/* Flat array of all grids' data. */
unsigned char *grids_storage;
int num_grids;
/* Loose edges, each array element contains grid_size elements
* corresponding to vertices created by subdividing coarse edges. */
struct CCGElem **edges;
CCGElem **edges;
int num_edges;
/* Loose vertices. Every element corresponds to a loose vertex from a coarse
* mesh, every coarse loose vertex corresponds to a single subdivided
* element. */
struct CCGElem *vertices;
CCGElem *vertices;
int num_vertices;
/* Denotes which layers present in the elements.
*
@@ -174,7 +173,7 @@ typedef struct SubdivCCG {
int num_adjacent_vertices;
SubdivCCGAdjacentVertex *adjacent_vertices;
struct DMFlagMat *grid_flag_mats;
DMFlagMat *grid_flag_mats;
BLI_bitmap **grid_hidden;
/* TODO(sergey): Consider adding some accessors to a "decoded" geometry,
@@ -200,7 +199,7 @@ typedef struct SubdivCCG {
/* Indexed by face, indicates index of the first grid which corresponds to the face. */
int *start_face_grid_index;
} cache_;
} SubdivCCG;
};
/* Create CCG representation of subdivision surface.
*
@@ -213,10 +212,10 @@ typedef struct SubdivCCG {
* TODO(sergey): Allow some user-counter or more explicit control over who owns
* the Subdiv. The goal should be to allow viewport GL Mesh and CCG to share
* same Subsurf without conflicts. */
struct SubdivCCG *BKE_subdiv_to_ccg(struct Subdiv *subdiv,
const SubdivToCCGSettings *settings,
SubdivCCGMaskEvaluator *mask_evaluator,
SubdivCCGMaterialFlagsEvaluator *material_flags_evaluator);
SubdivCCG *BKE_subdiv_to_ccg(Subdiv *subdiv,
const SubdivToCCGSettings *settings,
SubdivCCGMaskEvaluator *mask_evaluator,
SubdivCCGMaterialFlagsEvaluator *material_flags_evaluator);
/* Destroy CCG representation of subdivision surface. */
void BKE_subdiv_ccg_destroy(SubdivCCG *subdiv_ccg);
@@ -224,20 +223,20 @@ void BKE_subdiv_ccg_destroy(SubdivCCG *subdiv_ccg);
/* Helper function, creates Mesh structure which is properly setup to use
* grids.
*/
struct Mesh *BKE_subdiv_to_ccg_mesh(struct Subdiv *subdiv,
const SubdivToCCGSettings *settings,
const struct Mesh *coarse_mesh);
Mesh *BKE_subdiv_to_ccg_mesh(Subdiv *subdiv,
const SubdivToCCGSettings *settings,
const Mesh *coarse_mesh);
/* Create a key for accessing grid elements at a given level. */
void BKE_subdiv_ccg_key(struct CCGKey *key, const SubdivCCG *subdiv_ccg, int level);
void BKE_subdiv_ccg_key_top_level(struct CCGKey *key, const SubdivCCG *subdiv_ccg);
void BKE_subdiv_ccg_key(CCGKey *key, const SubdivCCG *subdiv_ccg, int level);
void BKE_subdiv_ccg_key_top_level(CCGKey *key, const SubdivCCG *subdiv_ccg);
/* Recalculate all normals based on grid element coordinates. */
void BKE_subdiv_ccg_recalc_normals(SubdivCCG *subdiv_ccg);
/* Update normals of affected faces. */
void BKE_subdiv_ccg_update_normals(SubdivCCG *subdiv_ccg,
struct CCGFace **effected_faces,
CCGFace **effected_faces,
int num_effected_faces);
/* Average grid coordinates and normals along the grid boundaries. */
@@ -245,7 +244,7 @@ void BKE_subdiv_ccg_average_grids(SubdivCCG *subdiv_ccg);
/* Similar to above, but only updates given faces. */
void BKE_subdiv_ccg_average_stitch_faces(SubdivCCG *subdiv_ccg,
struct CCGFace **effected_faces,
CCGFace **effected_faces,
int num_effected_faces);
/* Get geometry counters at the current subdivision level. */
@@ -255,13 +254,13 @@ void BKE_subdiv_ccg_topology_counters(const SubdivCCG *subdiv_ccg,
int *r_num_faces,
int *r_num_loops);
typedef struct SubdivCCGNeighbors {
struct SubdivCCGNeighbors {
SubdivCCGCoord *coords;
int size;
int num_duplicates;
SubdivCCGCoord coords_fixed[256];
} SubdivCCGNeighbors;
};
void BKE_subdiv_ccg_print_coord(const char *message, const SubdivCCGCoord *coord);
bool BKE_subdiv_ccg_check_coord_valid(const SubdivCCG *subdiv_ccg, const SubdivCCGCoord *coord);
@@ -296,11 +295,11 @@ void BKE_subdiv_ccg_eval_limit_point(const SubdivCCG *subdiv_ccg,
const SubdivCCGCoord *coord,
float r_point[3]);
typedef enum SubdivCCGAdjacencyType {
enum SubdivCCGAdjacencyType {
SUBDIV_CCG_ADJACENT_NONE,
SUBDIV_CCG_ADJACENT_VERTEX,
SUBDIV_CCG_ADJACENT_EDGE,
} SubdivCCGAdjacencyType;
};
/* Returns if a grid coordinates is adjacent to a coarse mesh edge, vertex or nothing. If it is
* adjacent to an edge, r_v1 and r_v2 will be set to the two vertices of that edge. If it is

View File

@@ -20,7 +20,7 @@ struct Subdiv;
* paint on a deformed mesh with sub-surf on it.
*
* vertex_cos are supposed to hold coordinates of the coarse mesh. */
void BKE_subdiv_deform_coarse_vertices(struct Subdiv *subdiv,
const struct Mesh *coarse_mesh,
void BKE_subdiv_deform_coarse_vertices(Subdiv *subdiv,
const Mesh *coarse_mesh,
float (*vertex_cos)[3],
int num_verts);

View File

@@ -15,41 +15,41 @@ struct OpenSubdiv_EvaluatorCache;
struct OpenSubdiv_EvaluatorSettings;
struct Subdiv;
typedef enum eSubdivEvaluatorType {
enum eSubdivEvaluatorType {
SUBDIV_EVALUATOR_TYPE_CPU,
SUBDIV_EVALUATOR_TYPE_GPU,
} eSubdivEvaluatorType;
};
/* Returns true if evaluator is ready for use. */
bool BKE_subdiv_eval_begin(struct Subdiv *subdiv,
bool BKE_subdiv_eval_begin(Subdiv *subdiv,
eSubdivEvaluatorType evaluator_type,
struct OpenSubdiv_EvaluatorCache *evaluator_cache,
const struct OpenSubdiv_EvaluatorSettings *settings);
OpenSubdiv_EvaluatorCache *evaluator_cache,
const OpenSubdiv_EvaluatorSettings *settings);
/* coarse_vertex_cos is an optional argument which allows to override coordinates of the coarse
* mesh. */
bool BKE_subdiv_eval_begin_from_mesh(struct Subdiv *subdiv,
const struct Mesh *mesh,
bool BKE_subdiv_eval_begin_from_mesh(Subdiv *subdiv,
const Mesh *mesh,
const float (*coarse_vertex_cos)[3],
eSubdivEvaluatorType evaluator_type,
struct OpenSubdiv_EvaluatorCache *evaluator_cache);
bool BKE_subdiv_eval_refine_from_mesh(struct Subdiv *subdiv,
const struct Mesh *mesh,
OpenSubdiv_EvaluatorCache *evaluator_cache);
bool BKE_subdiv_eval_refine_from_mesh(Subdiv *subdiv,
const Mesh *mesh,
const float (*coarse_vertex_cos)[3]);
/* Makes sure displacement evaluator is initialized.
*
* NOTE: This function must be called once before evaluating displacement or
* final surface position. */
void BKE_subdiv_eval_init_displacement(struct Subdiv *subdiv);
void BKE_subdiv_eval_init_displacement(Subdiv *subdiv);
/* Single point queries. */
/* Evaluate point at a limit surface, with optional derivatives and normal. */
void BKE_subdiv_eval_limit_point(
struct Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3]);
void BKE_subdiv_eval_limit_point_and_derivatives(struct Subdiv *subdiv,
Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3]);
void BKE_subdiv_eval_limit_point_and_derivatives(Subdiv *subdiv,
int ptex_face_index,
float u,
float v,
@@ -57,17 +57,17 @@ void BKE_subdiv_eval_limit_point_and_derivatives(struct Subdiv *subdiv,
float r_dPdu[3],
float r_dPdv[3]);
void BKE_subdiv_eval_limit_point_and_normal(
struct Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3], float r_N[3]);
Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3], float r_N[3]);
/* Evaluate smoothly interpolated vertex data (such as ORCO). */
void BKE_subdiv_eval_vertex_data(struct Subdiv *subdiv,
void BKE_subdiv_eval_vertex_data(Subdiv *subdiv,
const int ptex_face_index,
const float u,
const float v,
float r_vertex_data[]);
/* Evaluate face-varying layer (such as UV). */
void BKE_subdiv_eval_face_varying(struct Subdiv *subdiv,
void BKE_subdiv_eval_face_varying(Subdiv *subdiv,
int face_varying_channel,
int ptex_face_index,
float u,
@@ -80,7 +80,7 @@ void BKE_subdiv_eval_face_varying(struct Subdiv *subdiv,
* BKE_subdiv_eval_final_point() which can easily evaluate derivatives.
* Would be nice to have displacement evaluation function which does not require
* knowing derivatives ahead of a time. */
void BKE_subdiv_eval_displacement(struct Subdiv *subdiv,
void BKE_subdiv_eval_displacement(Subdiv *subdiv,
int ptex_face_index,
float u,
float v,
@@ -90,4 +90,4 @@ void BKE_subdiv_eval_displacement(struct Subdiv *subdiv,
/* Evaluate point on a limit surface with displacement applied to it. */
void BKE_subdiv_eval_final_point(
struct Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3]);
Subdiv *subdiv, int ptex_face_index, float u, float v, float r_P[3]);

View File

@@ -28,13 +28,13 @@ struct SubdivSettings;
struct SubsurfModifierData;
/* Runtime subsurf modifier data, cached in modifier on evaluated meshes. */
typedef struct SubsurfRuntimeData {
struct SubsurfRuntimeData {
/* Subdivision settings, exists before descriptor or mesh wrapper is created. */
SubdivSettings settings;
/* Cached subdivision surface descriptor, with topology and settings. */
struct Subdiv *subdiv_cpu;
struct Subdiv *subdiv_gpu;
Subdiv *subdiv_cpu;
Subdiv *subdiv_gpu;
/* Recent usage markers for UI diagnostics. To avoid UI flicker due to races
* between evaluation and UI redraw, they are set to 2 when an evaluator is used,
@@ -53,43 +53,44 @@ typedef struct SubsurfRuntimeData {
int stats_totedge;
int stats_faces_num;
int stats_totloop;
} SubsurfRuntimeData;
};
SubdivSettings BKE_subsurf_modifier_settings_init(const struct SubsurfModifierData *smd,
SubdivSettings BKE_subsurf_modifier_settings_init(const SubsurfModifierData *smd,
bool use_render_params);
bool BKE_subsurf_modifier_runtime_init(struct SubsurfModifierData *smd, bool use_render_params);
bool BKE_subsurf_modifier_runtime_init(SubsurfModifierData *smd, bool use_render_params);
bool BKE_subsurf_modifier_use_custom_loop_normals(const struct SubsurfModifierData *smd,
const struct Mesh *mesh);
bool BKE_subsurf_modifier_use_custom_loop_normals(const SubsurfModifierData *smd,
const Mesh *mesh);
/**
* Return true if GPU subdivision evaluation is disabled by force due to incompatible mesh or
* modifier settings. This will only return true if GPU subdivision is enabled in the preferences
* and supported by the GPU. It is mainly useful for showing UI messages.
*/
bool BKE_subsurf_modifier_force_disable_gpu_evaluation_for_mesh(
const struct SubsurfModifierData *smd, const struct Mesh *mesh);
bool BKE_subsurf_modifier_force_disable_gpu_evaluation_for_mesh(const SubsurfModifierData *smd,
const Mesh *mesh);
/**
* \param skip_check_is_last: When true, we assume that the modifier passed is the last enabled
* modifier in the stack.
*/
bool BKE_subsurf_modifier_can_do_gpu_subdiv(const struct Scene *scene,
const struct Object *ob,
const struct Mesh *mesh,
const struct SubsurfModifierData *smd,
bool BKE_subsurf_modifier_can_do_gpu_subdiv(const Scene *scene,
const Object *ob,
const Mesh *mesh,
const SubsurfModifierData *smd,
int required_mode);
bool BKE_subsurf_modifier_has_gpu_subdiv(const struct Mesh *mesh);
bool BKE_subsurf_modifier_has_gpu_subdiv(const Mesh *mesh);
extern void (*BKE_subsurf_modifier_free_gpu_cache_cb)(struct Subdiv *subdiv);
extern void (*BKE_subsurf_modifier_free_gpu_cache_cb)(Subdiv *subdiv);
/**
* Main goal of this function is to give usable subdivision surface descriptor
* which matches settings and topology.
*/
struct Subdiv *BKE_subsurf_modifier_subdiv_descriptor_ensure(
struct SubsurfRuntimeData *runtime_data, const struct Mesh *mesh, bool for_draw_code);
Subdiv *BKE_subsurf_modifier_subdiv_descriptor_ensure(SubsurfRuntimeData *runtime_data,
const Mesh *mesh,
bool for_draw_code);
/**
* Return the #ModifierMode required for the evaluation of the subsurf modifier,

View File

@@ -10,4 +10,4 @@
struct Subdiv;
int BKE_subdiv_topology_num_fvar_layers_get(const struct Subdiv *subdiv);
int BKE_subdiv_topology_num_fvar_layers_get(const Subdiv *subdiv);

View File

@@ -17,19 +17,21 @@
struct CCGEdge;
struct CCGElem;
struct CCGFace;
struct CCGSubSurf;
struct CCGVert;
struct DMFlagMat;
struct DerivedMesh;
struct EdgeHash;
struct Mesh;
struct MeshElemMap;
struct MultiresModifierData;
struct Object;
struct PBVH;
struct SubsurfModifierData;
/**************************** External *****************************/
typedef enum SubsurfFlags {
enum SubsurfFlags {
SUBSURF_USE_RENDER_PARAMS = 1,
SUBSURF_IS_FINAL_CALC = 2,
SUBSURF_FOR_EDIT_MODE = 4,
@@ -37,16 +39,16 @@ typedef enum SubsurfFlags {
SUBSURF_ALLOC_PAINT_MASK = 16,
SUBSURF_USE_GPU_BACKEND = 32,
SUBSURF_IGNORE_SIMPLIFY = 64,
} SubsurfFlags;
};
ENUM_OPERATORS(SubsurfFlags, SUBSURF_IGNORE_SIMPLIFY);
struct DerivedMesh *subsurf_make_derived_from_derived(struct DerivedMesh *dm,
struct SubsurfModifierData *smd,
const struct Scene *scene,
float (*vertCos)[3],
SubsurfFlags flags);
DerivedMesh *subsurf_make_derived_from_derived(DerivedMesh *dm,
SubsurfModifierData *smd,
const Scene *scene,
float (*vertCos)[3],
SubsurfFlags flags);
void subsurf_calculate_limit_positions(struct Mesh *me, float (*r_positions)[3]);
void subsurf_calculate_limit_positions(Mesh *me, float (*r_positions)[3]);
/**
* Get grid-size from 'level', level must be greater than zero.
@@ -59,20 +61,20 @@ int BKE_ccg_gridsize(int level);
*/
int BKE_ccg_factor(int low_level, int high_level);
typedef enum MultiresModifiedFlags {
enum MultiresModifiedFlags {
/* indicates the grids have been sculpted on, so MDisps
* have to be updated */
MULTIRES_COORDS_MODIFIED = 1,
/* indicates elements have been hidden or unhidden */
MULTIRES_HIDDEN_MODIFIED = 2,
} MultiresModifiedFlags;
};
/**************************** Internal *****************************/
typedef struct CCGDerivedMesh {
struct CCGDerivedMesh {
DerivedMesh dm;
struct CCGSubSurf *ss;
CCGSubSurf *ss;
int freeSS;
int drawInteriorEdges, useSubsurfUv;
@@ -83,45 +85,45 @@ typedef struct CCGDerivedMesh {
struct {
int startVert;
int startEdge;
struct CCGEdge *edge;
CCGEdge *edge;
} * edgeMap;
struct {
int startVert;
int startEdge;
int startFace;
struct CCGFace *face;
CCGFace *face;
} * faceMap;
struct DMFlagMat *faceFlags;
DMFlagMat *faceFlags;
int *reverseFaceMap;
struct PBVH *pbvh;
PBVH *pbvh;
struct MeshElemMap *pmap;
MeshElemMap *pmap;
int *pmap_mem;
struct CCGElem **gridData;
CCGElem **gridData;
int *gridOffset;
struct CCGFace **gridFaces;
struct DMFlagMat *gridFlagMats;
CCGFace **gridFaces;
DMFlagMat *gridFlagMats;
unsigned int **gridHidden;
/* Elements in arrays above. */
unsigned int numGrid;
struct {
struct MultiresModifierData *mmd;
MultiresModifierData *mmd;
int local_mmd;
int lvl, totlvl;
float (*orco)[3];
struct Object *ob;
Object *ob;
MultiresModifiedFlags modified_flags;
} multires;
struct EdgeHash *ehash;
EdgeHash *ehash;
ThreadMutex loops_cache_lock;
ThreadRWMutex origindex_cache_rwlock;
} CCGDerivedMesh;
};

View File

@@ -29,11 +29,11 @@ bool BKE_volume_grid_bounds(openvdb::GridBase::ConstPtr grid,
openvdb::GridBase::ConstPtr BKE_volume_grid_shallow_transform(openvdb::GridBase::ConstPtr grid,
const blender::float4x4 &transform);
openvdb::GridBase::ConstPtr BKE_volume_grid_openvdb_for_metadata(const struct VolumeGrid *grid);
openvdb::GridBase::ConstPtr BKE_volume_grid_openvdb_for_read(const struct Volume *volume,
const struct VolumeGrid *grid);
openvdb::GridBase::Ptr BKE_volume_grid_openvdb_for_write(const struct Volume *volume,
struct VolumeGrid *grid,
openvdb::GridBase::ConstPtr BKE_volume_grid_openvdb_for_metadata(const VolumeGrid *grid);
openvdb::GridBase::ConstPtr BKE_volume_grid_openvdb_for_read(const Volume *volume,
const VolumeGrid *grid);
openvdb::GridBase::Ptr BKE_volume_grid_openvdb_for_write(const Volume *volume,
VolumeGrid *grid,
bool clear);
void BKE_volume_grid_clear_tree(Volume &volume, VolumeGrid &volume_grid);

View File

@@ -14,26 +14,25 @@ struct BMesh;
struct Mesh;
struct MultiresModifierData;
typedef struct MultiresUnsubdivideGrid {
struct MultiresUnsubdivideGrid {
/* For sanity checks. */
int grid_index;
int grid_size;
/** Grid coordinates in object space. */
float (*grid_co)[3];
};
} MultiresUnsubdivideGrid;
typedef struct MultiresUnsubdivideContext {
struct MultiresUnsubdivideContext {
/* Input Mesh to un-subdivide. */
struct Mesh *original_mesh;
struct MDisps *original_mdisp;
Mesh *original_mesh;
MDisps *original_mdisp;
/** Number of subdivision in the grids of the input mesh. */
int num_original_levels;
/** Level 0 base mesh after applying the maximum amount of unsubdivisions. */
struct Mesh *base_mesh;
Mesh *base_mesh;
/** Limit on how many levels down the unsubdivide operation should create, if possible. */
int max_new_levels;
@@ -49,21 +48,21 @@ typedef struct MultiresUnsubdivideContext {
/** Data for the new grids, indexed by base mesh loop index. */
int num_grids;
struct MultiresUnsubdivideGrid *base_mesh_grids;
MultiresUnsubdivideGrid *base_mesh_grids;
/* Private data. */
struct BMesh *bm_original_mesh;
BMesh *bm_original_mesh;
blender::Array<int> loop_to_face_map;
const int *base_to_orig_vmap;
} MultiresUnsubdivideContext;
};
/* --------------------------------------------------------------------
* Construct/destruct reshape context.
*/
void multires_unsubdivide_context_init(MultiresUnsubdivideContext *context,
struct Mesh *original_mesh,
struct MultiresModifierData *mmd);
Mesh *original_mesh,
MultiresModifierData *mmd);
void multires_unsubdivide_context_free(MultiresUnsubdivideContext *context);
/* --------------------------------------------------------------------

View File

@@ -18,13 +18,13 @@ struct Mesh;
struct OpenSubdiv_Converter;
struct SubdivSettings;
void BKE_subdiv_converter_init_for_mesh(struct OpenSubdiv_Converter *converter,
const struct SubdivSettings *settings,
const struct Mesh *mesh);
void BKE_subdiv_converter_init_for_mesh(OpenSubdiv_Converter *converter,
const SubdivSettings *settings,
const Mesh *mesh);
/* NOTE: Frees converter data, but not converter itself. This means, that if
* converter was allocated on heap, it is up to the user to free that memory. */
void BKE_subdiv_converter_free(struct OpenSubdiv_Converter *converter);
void BKE_subdiv_converter_free(OpenSubdiv_Converter *converter);
/* ============================ INTERNAL HELPERS ============================ */

View File

@@ -119,14 +119,14 @@ class ShaderModule {
GPUShader *static_shader_get(eShaderType shader_type);
GPUMaterial *material_shader_get(::Material *blender_mat,
struct bNodeTree *nodetree,
bNodeTree *nodetree,
eMaterialPipeline pipeline_type,
eMaterialGeometry geometry_type,
bool deferred_compilation);
GPUMaterial *world_shader_get(::World *blender_world, struct bNodeTree *nodetree);
GPUMaterial *world_shader_get(::World *blender_world, bNodeTree *nodetree);
GPUMaterial *material_shader_get(const char *name,
ListBase &materials,
struct bNodeTree *nodetree,
bNodeTree *nodetree,
eMaterialPipeline pipeline_type,
eMaterialGeometry geometry_type,
bool is_lookdev);

View File

@@ -71,7 +71,7 @@ class ObjectModule {
if (is_viewport) {
/* TODO(fclem): Avoid access to global DRW. */
const struct bContext *evil_C = DRW_context_state_get()->evil_C;
const bContext *evil_C = DRW_context_state_get()->evil_C;
const bool playing = (evil_C != nullptr) ?
ED_screen_animation_playing(CTX_wm_manager(evil_C)) != nullptr :
false;

View File

@@ -23,13 +23,13 @@
namespace blender::draw::image_engine {
struct IMAGE_InstanceData {
struct Image *image;
Image *image;
/** Usage data of the previous time, to identify changes that require a full update. */
ImageUsage last_usage;
PartialImageUpdater partial_update;
struct DRWView *view;
DRWView *view;
ShaderParameters sh_params;
struct {
/**

View File

@@ -12,8 +12,8 @@
#include "BKE_image_partial_update.hh"
struct PartialImageUpdater {
struct PartialUpdateUser *user;
const struct Image *image;
PartialUpdateUser *user;
const Image *image;
/**
* \brief Ensure that there is a partial update user for the given image.

View File

@@ -31,36 +31,36 @@
/* Forward declarations */
struct ImBuf;
typedef struct OVERLAY_FramebufferList {
struct GPUFrameBuffer *overlay_default_fb;
struct GPUFrameBuffer *overlay_line_fb;
struct GPUFrameBuffer *overlay_color_only_fb;
struct GPUFrameBuffer *overlay_in_front_fb;
struct GPUFrameBuffer *overlay_line_in_front_fb;
struct GPUFrameBuffer *outlines_prepass_fb;
struct GPUFrameBuffer *outlines_resolve_fb;
} OVERLAY_FramebufferList;
struct OVERLAY_FramebufferList {
GPUFrameBuffer *overlay_default_fb;
GPUFrameBuffer *overlay_line_fb;
GPUFrameBuffer *overlay_color_only_fb;
GPUFrameBuffer *overlay_in_front_fb;
GPUFrameBuffer *overlay_line_in_front_fb;
GPUFrameBuffer *outlines_prepass_fb;
GPUFrameBuffer *outlines_resolve_fb;
};
typedef struct OVERLAY_TextureList {
struct GPUTexture *temp_depth_tx;
struct GPUTexture *dummy_depth_tx;
struct GPUTexture *outlines_id_tx;
struct GPUTexture *overlay_color_tx;
struct GPUTexture *overlay_line_tx;
} OVERLAY_TextureList;
struct OVERLAY_TextureList {
GPUTexture *temp_depth_tx;
GPUTexture *dummy_depth_tx;
GPUTexture *outlines_id_tx;
GPUTexture *overlay_color_tx;
GPUTexture *overlay_line_tx;
};
#define NOT_IN_FRONT 0
#define IN_FRONT 1
typedef enum OVERLAY_UVLineStyle {
enum OVERLAY_UVLineStyle {
OVERLAY_UV_LINE_STYLE_OUTLINE = 0,
OVERLAY_UV_LINE_STYLE_DASH = 1,
OVERLAY_UV_LINE_STYLE_BLACK = 2,
OVERLAY_UV_LINE_STYLE_WHITE = 3,
OVERLAY_UV_LINE_STYLE_SHADOW = 4,
} OVERLAY_UVLineStyle;
};
typedef struct OVERLAY_PassList {
struct OVERLAY_PassList {
DRWPass *antialiasing_ps;
DRWPass *armature_ps[2];
DRWPass *armature_bone_select_ps;
@@ -130,10 +130,10 @@ typedef struct OVERLAY_PassList {
DRWPass *wireframe_ps;
DRWPass *wireframe_xray_ps;
DRWPass *xray_fade_ps;
} OVERLAY_PassList;
};
/* Data used by GLSL shader. */
typedef struct OVERLAY_ShadingData {
struct OVERLAY_ShadingData {
/** Wireframe */
float wire_step_param;
float wire_opacity;
@@ -141,9 +141,9 @@ typedef struct OVERLAY_ShadingData {
float edit_curve_normal_length;
/** Edit Mesh */
int data_mask[4];
} OVERLAY_ShadingData;
};
typedef struct OVERLAY_ExtraCallBuffers {
struct OVERLAY_ExtraCallBuffers {
DRWCallBuffer *camera_frame;
DRWCallBuffer *camera_tria[2];
DRWCallBuffer *camera_distances;
@@ -205,9 +205,9 @@ typedef struct OVERLAY_ExtraCallBuffers {
DRWShadingGroup *extra_wire;
DRWShadingGroup *extra_loose_points;
} OVERLAY_ExtraCallBuffers;
};
typedef struct OVERLAY_ArmatureCallBuffersInner {
struct OVERLAY_ArmatureCallBuffersInner {
DRWCallBuffer *box_outline;
DRWCallBuffer *box_fill;
@@ -233,14 +233,14 @@ typedef struct OVERLAY_ArmatureCallBuffersInner {
DRWShadingGroup *custom_wire;
GHash *custom_shapes_ghash;
} OVERLAY_ArmatureCallBuffersInner;
};
typedef struct OVERLAY_ArmatureCallBuffers {
struct OVERLAY_ArmatureCallBuffers {
OVERLAY_ArmatureCallBuffersInner solid;
OVERLAY_ArmatureCallBuffersInner transp;
} OVERLAY_ArmatureCallBuffers;
};
typedef struct OVERLAY_PrivateData {
struct OVERLAY_PrivateData {
DRWShadingGroup *armature_bone_select_act_grp;
DRWShadingGroup *armature_bone_select_grp;
DRWShadingGroup *edit_curve_normal_grp[2];
@@ -410,8 +410,8 @@ typedef struct OVERLAY_PrivateData {
float total_area_ratio;
/* stencil overlay */
struct Image *stencil_image;
struct ImBuf *stencil_ibuf;
Image *stencil_image;
ImBuf *stencil_ibuf;
void *stencil_lock;
/* mask overlay */
@@ -436,13 +436,13 @@ typedef struct OVERLAY_PrivateData {
double time;
bool any_animated;
} mode_transfer;
} OVERLAY_PrivateData; /* Transient data */
}; /* Transient data */
typedef struct OVERLAY_StorageList {
struct OVERLAY_PrivateData *pd;
} OVERLAY_StorageList;
struct OVERLAY_StorageList {
OVERLAY_PrivateData *pd;
};
typedef struct OVERLAY_Data {
struct OVERLAY_Data {
void *engine_type;
OVERLAY_FramebufferList *fbl;
OVERLAY_TextureList *txl;
@@ -450,17 +450,17 @@ typedef struct OVERLAY_Data {
OVERLAY_StorageList *stl;
void *instance;
} OVERLAY_Data;
};
typedef struct OVERLAY_DupliData {
struct OVERLAY_DupliData {
DRWShadingGroup *wire_shgrp;
DRWShadingGroup *outline_shgrp;
DRWShadingGroup *extra_shgrp;
struct GPUBatch *wire_geom;
struct GPUBatch *outline_geom;
struct GPUBatch *extra_geom;
GPUBatch *wire_geom;
GPUBatch *outline_geom;
GPUBatch *extra_geom;
short base_flag;
} OVERLAY_DupliData;
};
struct BoneInstanceData {
/* Keep sync with bone instance vertex format (OVERLAY_InstanceFormats) */
@@ -486,20 +486,20 @@ struct BoneInstanceData {
BoneInstanceData(Object *ob, const float *pos, const float radius, const float color[4]);
};
typedef struct OVERLAY_InstanceFormats {
struct GPUVertFormat *instance_pos;
struct GPUVertFormat *instance_extra;
struct GPUVertFormat *instance_bone;
struct GPUVertFormat *instance_bone_outline;
struct GPUVertFormat *instance_bone_envelope;
struct GPUVertFormat *instance_bone_envelope_distance;
struct GPUVertFormat *instance_bone_envelope_outline;
struct GPUVertFormat *instance_bone_stick;
struct GPUVertFormat *pos;
struct GPUVertFormat *pos_color;
struct GPUVertFormat *wire_extra;
struct GPUVertFormat *point_extra;
} OVERLAY_InstanceFormats;
struct OVERLAY_InstanceFormats {
GPUVertFormat *instance_pos;
GPUVertFormat *instance_extra;
GPUVertFormat *instance_bone;
GPUVertFormat *instance_bone_outline;
GPUVertFormat *instance_bone_envelope;
GPUVertFormat *instance_bone_envelope_distance;
GPUVertFormat *instance_bone_envelope_outline;
GPUVertFormat *instance_bone_stick;
GPUVertFormat *pos;
GPUVertFormat *pos_color;
GPUVertFormat *wire_extra;
GPUVertFormat *point_extra;
};
/* Pack data into the last row of the 4x4 matrix. It will be decoded by the vertex shader. */
BLI_INLINE void pack_data_in_mat4(
@@ -535,7 +535,7 @@ void OVERLAY_xray_depth_infront_copy(OVERLAY_Data *vedata);
/**
* Return true if armature should be handled by the pose mode engine.
*/
bool OVERLAY_armature_is_pose_mode(Object *ob, const struct DRWContextState *draw_ctx);
bool OVERLAY_armature_is_pose_mode(Object *ob, const DRWContextState *draw_ctx);
void OVERLAY_armature_cache_init(OVERLAY_Data *vedata);
void OVERLAY_armature_cache_populate(OVERLAY_Data *vedata, Object *ob);
void OVERLAY_edit_armature_cache_populate(OVERLAY_Data *vedata, Object *ob);
@@ -623,11 +623,11 @@ void OVERLAY_empty_shape(OVERLAY_ExtraCallBuffers *cb,
char draw_type,
const float color[4]);
void OVERLAY_extra_loose_points(OVERLAY_ExtraCallBuffers *cb,
struct GPUBatch *geom,
GPUBatch *geom,
const float mat[4][4],
const float color[4]);
void OVERLAY_extra_wire(OVERLAY_ExtraCallBuffers *cb,
struct GPUBatch *geom,
GPUBatch *geom,
const float mat[4][4],
const float color[4]);

View File

@@ -114,6 +114,8 @@ struct ObjectState {
ObjectState(const SceneState &scene_state, Object *ob);
};
struct SceneResources;
class CavityEffect {
private:
/* This value must be kept in sync with the one declared at
@@ -128,8 +130,8 @@ class CavityEffect {
bool cavity_enabled_ = false;
public:
void init(const SceneState &scene_state, struct SceneResources &resources);
void setup_resolve_pass(PassSimple &pass, struct SceneResources &resources);
void init(const SceneState &scene_state, SceneResources &resources);
void setup_resolve_pass(PassSimple &pass, SceneResources &resources);
private:
void load_samples_buf(int ssao_samples);

View File

@@ -25,49 +25,45 @@ struct Volume;
struct bGPdata;
struct GreasePencil;
#include "BKE_mesh_types.hh"
#ifdef __cplusplus
extern "C" {
#endif
#include "BKE_mesh.h"
/* -------------------------------------------------------------------- */
/** \name Expose via BKE callbacks
* \{ */
void DRW_curve_batch_cache_dirty_tag(struct Curve *cu, int mode);
void DRW_curve_batch_cache_validate(struct Curve *cu);
void DRW_curve_batch_cache_free(struct Curve *cu);
void DRW_curve_batch_cache_dirty_tag(Curve *cu, int mode);
void DRW_curve_batch_cache_validate(Curve *cu);
void DRW_curve_batch_cache_free(Curve *cu);
void DRW_mesh_batch_cache_dirty_tag(struct Mesh *me, eMeshBatchDirtyMode mode);
void DRW_mesh_batch_cache_validate(struct Object *object, struct Mesh *me);
void DRW_mesh_batch_cache_dirty_tag(Mesh *me, eMeshBatchDirtyMode mode);
void DRW_mesh_batch_cache_validate(Object *object, Mesh *me);
void DRW_mesh_batch_cache_free(void *batch_cache);
void DRW_lattice_batch_cache_dirty_tag(struct Lattice *lt, int mode);
void DRW_lattice_batch_cache_validate(struct Lattice *lt);
void DRW_lattice_batch_cache_free(struct Lattice *lt);
void DRW_lattice_batch_cache_dirty_tag(Lattice *lt, int mode);
void DRW_lattice_batch_cache_validate(Lattice *lt);
void DRW_lattice_batch_cache_free(Lattice *lt);
void DRW_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode);
void DRW_particle_batch_cache_free(struct ParticleSystem *psys);
void DRW_particle_batch_cache_dirty_tag(ParticleSystem *psys, int mode);
void DRW_particle_batch_cache_free(ParticleSystem *psys);
void DRW_gpencil_batch_cache_dirty_tag(struct bGPdata *gpd);
void DRW_gpencil_batch_cache_free(struct bGPdata *gpd);
void DRW_gpencil_batch_cache_dirty_tag(bGPdata *gpd);
void DRW_gpencil_batch_cache_free(bGPdata *gpd);
void DRW_curves_batch_cache_dirty_tag(struct Curves *curves, int mode);
void DRW_curves_batch_cache_validate(struct Curves *curves);
void DRW_curves_batch_cache_free(struct Curves *curves);
void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode);
void DRW_curves_batch_cache_validate(Curves *curves);
void DRW_curves_batch_cache_free(Curves *curves);
void DRW_pointcloud_batch_cache_dirty_tag(struct PointCloud *pointcloud, int mode);
void DRW_pointcloud_batch_cache_validate(struct PointCloud *pointcloud);
void DRW_pointcloud_batch_cache_free(struct PointCloud *pointcloud);
void DRW_pointcloud_batch_cache_dirty_tag(PointCloud *pointcloud, int mode);
void DRW_pointcloud_batch_cache_validate(PointCloud *pointcloud);
void DRW_pointcloud_batch_cache_free(PointCloud *pointcloud);
void DRW_volume_batch_cache_dirty_tag(struct Volume *volume, int mode);
void DRW_volume_batch_cache_validate(struct Volume *volume);
void DRW_volume_batch_cache_free(struct Volume *volume);
void DRW_volume_batch_cache_dirty_tag(Volume *volume, int mode);
void DRW_volume_batch_cache_validate(Volume *volume);
void DRW_volume_batch_cache_free(Volume *volume);
void DRW_grease_pencil_batch_cache_dirty_tag(struct GreasePencil *grase_pencil, int mode);
void DRW_grease_pencil_batch_cache_validate(struct GreasePencil *grase_pencil);
void DRW_grease_pencil_batch_cache_free(struct GreasePencil *grase_pencil);
void DRW_grease_pencil_batch_cache_dirty_tag(GreasePencil *grase_pencil, int mode);
void DRW_grease_pencil_batch_cache_validate(GreasePencil *grase_pencil);
void DRW_grease_pencil_batch_cache_free(GreasePencil *grase_pencil);
/** \} */
@@ -75,15 +71,15 @@ void DRW_grease_pencil_batch_cache_free(struct GreasePencil *grase_pencil);
/** \name Garbage Collection
* \{ */
void DRW_batch_cache_free_old(struct Object *ob, int ctime);
void DRW_batch_cache_free_old(Object *ob, int ctime);
/**
* Thread safety need to be assured by caller. Don't call this during drawing.
* \note For now this only free the shading batches / VBO if any cd layers is not needed anymore.
*/
void DRW_mesh_batch_cache_free_old(struct Mesh *me, int ctime);
void DRW_curves_batch_cache_free_old(struct Curves *curves, int ctime);
void DRW_pointcloud_batch_cache_free_old(struct PointCloud *pointcloud, int ctime);
void DRW_mesh_batch_cache_free_old(Mesh *me, int ctime);
void DRW_curves_batch_cache_free_old(Curves *curves, int ctime);
void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime);
/** \} */
@@ -91,7 +87,7 @@ void DRW_pointcloud_batch_cache_free_old(struct PointCloud *pointcloud, int ctim
/** \name Generic
* \{ */
void DRW_vertbuf_create_wiredata(struct GPUVertBuf *vbo, int vert_len);
void DRW_vertbuf_create_wiredata(GPUVertBuf *vbo, int vert_len);
/** \} */
@@ -99,15 +95,15 @@ void DRW_vertbuf_create_wiredata(struct GPUVertBuf *vbo, int vert_len);
/** \name Curve
* \{ */
void DRW_curve_batch_cache_create_requested(struct Object *ob, const struct Scene *scene);
void DRW_curve_batch_cache_create_requested(Object *ob, const Scene *scene);
int DRW_curve_material_count_get(struct Curve *cu);
int DRW_curve_material_count_get(Curve *cu);
struct GPUBatch *DRW_curve_batch_cache_get_wire_edge(struct Curve *cu);
struct GPUBatch *DRW_curve_batch_cache_get_wire_edge_viewer_attribute(struct Curve *cu);
struct GPUBatch *DRW_curve_batch_cache_get_normal_edge(struct Curve *cu);
struct GPUBatch *DRW_curve_batch_cache_get_edit_edges(struct Curve *cu);
struct GPUBatch *DRW_curve_batch_cache_get_edit_verts(struct Curve *cu);
GPUBatch *DRW_curve_batch_cache_get_wire_edge(Curve *cu);
GPUBatch *DRW_curve_batch_cache_get_wire_edge_viewer_attribute(Curve *cu);
GPUBatch *DRW_curve_batch_cache_get_normal_edge(Curve *cu);
GPUBatch *DRW_curve_batch_cache_get_edit_edges(Curve *cu);
GPUBatch *DRW_curve_batch_cache_get_edit_verts(Curve *cu);
/** \} */
@@ -115,11 +111,9 @@ struct GPUBatch *DRW_curve_batch_cache_get_edit_verts(struct Curve *cu);
/** \name Lattice
* \{ */
struct GPUBatch *DRW_lattice_batch_cache_get_all_edges(struct Lattice *lt,
bool use_weight,
int actdef);
struct GPUBatch *DRW_lattice_batch_cache_get_all_verts(struct Lattice *lt);
struct GPUBatch *DRW_lattice_batch_cache_get_edit_verts(struct Lattice *lt);
GPUBatch *DRW_lattice_batch_cache_get_all_edges(Lattice *lt, bool use_weight, int actdef);
GPUBatch *DRW_lattice_batch_cache_get_all_verts(Lattice *lt);
GPUBatch *DRW_lattice_batch_cache_get_edit_verts(Lattice *lt);
/** \} */
@@ -127,7 +121,7 @@ struct GPUBatch *DRW_lattice_batch_cache_get_edit_verts(struct Lattice *lt);
/** \name Curves
* \{ */
int DRW_curves_material_count_get(struct Curves *curves);
int DRW_curves_material_count_get(Curves *curves);
/**
* Provide GPU access to a specific evaluated attribute on curves.
@@ -135,14 +129,14 @@ int DRW_curves_material_count_get(struct Curves *curves);
* \return A pointer to location where the texture will be
* stored, which will be filled by #DRW_shgroup_curves_create_sub.
*/
struct GPUVertBuf **DRW_curves_texture_for_evaluated_attribute(struct Curves *curves,
const char *name,
bool *r_is_point_domain);
GPUVertBuf **DRW_curves_texture_for_evaluated_attribute(Curves *curves,
const char *name,
bool *r_is_point_domain);
struct GPUBatch *DRW_curves_batch_cache_get_edit_points(struct Curves *curves);
struct GPUBatch *DRW_curves_batch_cache_get_edit_lines(struct Curves *curves);
GPUBatch *DRW_curves_batch_cache_get_edit_points(Curves *curves);
GPUBatch *DRW_curves_batch_cache_get_edit_lines(Curves *curves);
void DRW_curves_batch_cache_create_requested(struct Object *ob);
void DRW_curves_batch_cache_create_requested(Object *ob);
/** \} */
@@ -150,15 +144,14 @@ void DRW_curves_batch_cache_create_requested(struct Object *ob);
/** \name PointCloud
* \{ */
int DRW_pointcloud_material_count_get(struct PointCloud *pointcloud);
int DRW_pointcloud_material_count_get(PointCloud *pointcloud);
struct GPUVertBuf *DRW_pointcloud_position_and_radius_buffer_get(struct Object *ob);
GPUVertBuf *DRW_pointcloud_position_and_radius_buffer_get(Object *ob);
struct GPUVertBuf **DRW_pointcloud_evaluated_attribute(struct PointCloud *pointcloud,
const char *name);
struct GPUBatch *DRW_pointcloud_batch_cache_get_dots(struct Object *ob);
GPUVertBuf **DRW_pointcloud_evaluated_attribute(PointCloud *pointcloud, const char *name);
GPUBatch *DRW_pointcloud_batch_cache_get_dots(Object *ob);
void DRW_pointcloud_batch_cache_create_requested(struct Object *ob);
void DRW_pointcloud_batch_cache_create_requested(Object *ob);
/** \} */
@@ -166,10 +159,10 @@ void DRW_pointcloud_batch_cache_create_requested(struct Object *ob);
/** \name Volume
* \{ */
int DRW_volume_material_count_get(struct Volume *volume);
int DRW_volume_material_count_get(Volume *volume);
struct GPUBatch *DRW_volume_batch_cache_get_wireframes_face(struct Volume *volume);
struct GPUBatch *DRW_volume_batch_cache_get_selection_surface(struct Volume *volume);
GPUBatch *DRW_volume_batch_cache_get_wireframes_face(Volume *volume);
GPUBatch *DRW_volume_batch_cache_get_selection_surface(Volume *volume);
/** \} */
@@ -180,34 +173,31 @@ struct GPUBatch *DRW_volume_batch_cache_get_selection_surface(struct Volume *vol
/**
* Can be called for any surface type. Mesh *me is the final mesh.
*/
void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph,
struct Object *ob,
struct Mesh *me,
const struct Scene *scene,
void DRW_mesh_batch_cache_create_requested(TaskGraph *task_graph,
Object *ob,
Mesh *me,
const Scene *scene,
bool is_paint_mode,
bool use_hide);
struct GPUBatch *DRW_mesh_batch_cache_get_all_verts(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_all_edges(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_loose_edges(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edge_detection(struct Mesh *me, bool *r_is_manifold);
struct GPUBatch *DRW_mesh_batch_cache_get_surface(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_surface_edges(struct Object *object, struct Mesh *me);
struct GPUBatch **DRW_mesh_batch_cache_get_surface_shaded(struct Object *object,
struct Mesh *me,
struct GPUMaterial **gpumat_array,
uint gpumat_array_len);
GPUBatch *DRW_mesh_batch_cache_get_all_verts(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_all_edges(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_loose_edges(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edge_detection(Mesh *me, bool *r_is_manifold);
GPUBatch *DRW_mesh_batch_cache_get_surface(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_surface_edges(Object *object, Mesh *me);
GPUBatch **DRW_mesh_batch_cache_get_surface_shaded(Object *object,
Mesh *me,
GPUMaterial **gpumat_array,
uint gpumat_array_len);
struct GPUBatch **DRW_mesh_batch_cache_get_surface_texpaint(struct Object *object,
struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_surface_texpaint_single(struct Object *object,
struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_surface_vertpaint(struct Object *object,
struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_surface_sculpt(struct Object *object, struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_surface_weights(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_sculpt_overlays(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_surface_viewer_attribute(struct Mesh *me);
GPUBatch **DRW_mesh_batch_cache_get_surface_texpaint(Object *object, Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_surface_texpaint_single(Object *object, Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_surface_vertpaint(Object *object, Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_surface_sculpt(Object *object, Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_surface_weights(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_sculpt_overlays(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_surface_viewer_attribute(Mesh *me);
/** \} */
@@ -215,13 +205,13 @@ struct GPUBatch *DRW_mesh_batch_cache_get_surface_viewer_attribute(struct Mesh *
/** \name Edit-Mesh Drawing
* \{ */
struct GPUBatch *DRW_mesh_batch_cache_get_edit_triangles(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edit_vertices(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edit_edges(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edit_vert_normals(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edit_loop_normals(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edit_facedots(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edit_skin_roots(struct Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edit_triangles(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edit_vertices(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edit_edges(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edit_vert_normals(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edit_loop_normals(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edit_facedots(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edit_skin_roots(Mesh *me);
/** \} */
@@ -229,10 +219,10 @@ struct GPUBatch *DRW_mesh_batch_cache_get_edit_skin_roots(struct Mesh *me);
/** \name Edit-mesh Selection
* \{ */
struct GPUBatch *DRW_mesh_batch_cache_get_triangles_with_select_id(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_facedots_with_select_id(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edges_with_select_id(struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_verts_with_select_id(struct Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_triangles_with_select_id(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_facedots_with_select_id(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edges_with_select_id(Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_verts_with_select_id(Mesh *me);
/** \} */
@@ -240,7 +230,7 @@ struct GPUBatch *DRW_mesh_batch_cache_get_verts_with_select_id(struct Mesh *me);
/** \name Object Mode Wireframe Overlays
* \{ */
struct GPUBatch *DRW_mesh_batch_cache_get_wireframes_face(struct Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_wireframes_face(Mesh *me);
/** \} */
@@ -255,16 +245,15 @@ struct GPUBatch *DRW_mesh_batch_cache_get_wireframes_face(struct Mesh *me);
* The `cache->tot_area` and cache->tot_uv_area` update are calculation are
* only valid after calling `DRW_mesh_batch_cache_create_requested`.
*/
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_faces_stretch_area(struct Object *object,
struct Mesh *me,
float **tot_area,
float **tot_uv_area);
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(struct Object *object,
struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_faces(struct Object *object, struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_edges(struct Object *object, struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_verts(struct Object *object, struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edituv_facedots(struct Object *object, struct Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edituv_faces_stretch_area(Object *object,
Mesh *me,
float **tot_area,
float **tot_uv_area);
GPUBatch *DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(Object *object, Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edituv_faces(Object *object, Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edituv_edges(Object *object, Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edituv_verts(Object *object, Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edituv_facedots(Object *object, Mesh *me);
/** \} */
@@ -272,8 +261,8 @@ struct GPUBatch *DRW_mesh_batch_cache_get_edituv_facedots(struct Object *object,
/** \name For Image UV Editor
* \{ */
struct GPUBatch *DRW_mesh_batch_cache_get_uv_edges(struct Object *object, struct Mesh *me);
struct GPUBatch *DRW_mesh_batch_cache_get_edit_mesh_analysis(struct Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_uv_edges(Object *object, Mesh *me);
GPUBatch *DRW_mesh_batch_cache_get_edit_mesh_analysis(Mesh *me);
/** \} */
@@ -281,9 +270,9 @@ struct GPUBatch *DRW_mesh_batch_cache_get_edit_mesh_analysis(struct Mesh *me);
/** \name For Direct Data Access
* \{ */
struct GPUVertBuf *DRW_mesh_batch_cache_pos_vertbuf_get(struct Mesh *me);
GPUVertBuf *DRW_mesh_batch_cache_pos_vertbuf_get(Mesh *me);
int DRW_mesh_material_count_get(const struct Object *object, const struct Mesh *me);
int DRW_mesh_material_count_get(const Object *object, const Mesh *me);
/* Edit mesh bitflags (is this the right place?) */
enum {
@@ -318,24 +307,19 @@ enum {
/** \name Particles
* \{ */
struct GPUBatch *DRW_particles_batch_cache_get_hair(struct Object *object,
struct ParticleSystem *psys,
struct ModifierData *md);
struct GPUBatch *DRW_particles_batch_cache_get_dots(struct Object *object,
struct ParticleSystem *psys);
struct GPUBatch *DRW_particles_batch_cache_get_edit_strands(struct Object *object,
struct ParticleSystem *psys,
struct PTCacheEdit *edit,
bool use_weight);
struct GPUBatch *DRW_particles_batch_cache_get_edit_inner_points(struct Object *object,
struct ParticleSystem *psys,
struct PTCacheEdit *edit);
struct GPUBatch *DRW_particles_batch_cache_get_edit_tip_points(struct Object *object,
struct ParticleSystem *psys,
struct PTCacheEdit *edit);
GPUBatch *DRW_particles_batch_cache_get_hair(Object *object,
ParticleSystem *psys,
ModifierData *md);
GPUBatch *DRW_particles_batch_cache_get_dots(Object *object, ParticleSystem *psys);
GPUBatch *DRW_particles_batch_cache_get_edit_strands(Object *object,
ParticleSystem *psys,
PTCacheEdit *edit,
bool use_weight);
GPUBatch *DRW_particles_batch_cache_get_edit_inner_points(Object *object,
ParticleSystem *psys,
PTCacheEdit *edit);
GPUBatch *DRW_particles_batch_cache_get_edit_tip_points(Object *object,
ParticleSystem *psys,
PTCacheEdit *edit);
/** \} */
#ifdef __cplusplus
}
#endif

View File

@@ -13,15 +13,15 @@ struct wmOperatorType;
namespace blender::ed::geometry {
/* *** geometry_attributes.cc *** */
void GEOMETRY_OT_attribute_add(struct wmOperatorType *ot);
void GEOMETRY_OT_attribute_remove(struct wmOperatorType *ot);
void GEOMETRY_OT_color_attribute_add(struct wmOperatorType *ot);
void GEOMETRY_OT_color_attribute_remove(struct wmOperatorType *ot);
void GEOMETRY_OT_color_attribute_render_set(struct wmOperatorType *ot);
void GEOMETRY_OT_color_attribute_duplicate(struct wmOperatorType *ot);
void GEOMETRY_OT_attribute_convert(struct wmOperatorType *ot);
void GEOMETRY_OT_color_attribute_convert(struct wmOperatorType *ot);
void GEOMETRY_OT_attribute_add(wmOperatorType *ot);
void GEOMETRY_OT_attribute_remove(wmOperatorType *ot);
void GEOMETRY_OT_color_attribute_add(wmOperatorType *ot);
void GEOMETRY_OT_color_attribute_remove(wmOperatorType *ot);
void GEOMETRY_OT_color_attribute_render_set(wmOperatorType *ot);
void GEOMETRY_OT_color_attribute_duplicate(wmOperatorType *ot);
void GEOMETRY_OT_attribute_convert(wmOperatorType *ot);
void GEOMETRY_OT_color_attribute_convert(wmOperatorType *ot);
void GEOMETRY_OT_execute_node_group(struct wmOperatorType *ot);
void GEOMETRY_OT_execute_node_group(wmOperatorType *ot);
} // namespace blender::ed::geometry

View File

@@ -243,7 +243,7 @@ using uiListItemGetNameFn =
* to provide the name still.
*/
void UI_list_filter_and_sort_items(uiList *ui_list,
const struct bContext *C,
const bContext *C,
uiListItemFilterFn item_filter_fn,
PointerRNA *dataptr,
const char *propname,

View File

@@ -243,7 +243,7 @@ class AbstractTreeViewItem : public AbstractViewItem, public TreeViewItemContain
void ensure_parents_uncollapsed();
private:
static void tree_row_click_fn(struct bContext *, void *, void *);
static void tree_row_click_fn( bContext *, void *, void *);
static void collapse_chevron_click_fn(bContext *, void *but_arg1, void *);
static bool is_collapse_chevron_but(const uiBut *but);
@@ -301,7 +301,7 @@ class BasicTreeViewItem : public AbstractTreeViewItem {
IsActiveFn is_active_fn_;
private:
static void tree_row_click_fn(struct bContext *C, void *arg1, void *arg2);
static void tree_row_click_fn( bContext *C, void *arg1, void *arg2);
std::optional<bool> should_be_active() const override;
void on_activate(bContext &C) override;

View File

@@ -467,9 +467,9 @@ struct uiButtonGroup {
};
struct uiBlockDynamicListener {
struct uiBlockDynamicListener *next, *prev;
uiBlockDynamicListener *next, *prev;
void (*listener_func)(const struct wmRegionListenerParams *params);
void (*listener_func)(const wmRegionListenerParams *params);
};
struct uiBlock {

View File

@@ -10,5 +10,5 @@
struct wmOperatorType;
void WM_OT_alembic_export(struct wmOperatorType *ot);
void WM_OT_alembic_import(struct wmOperatorType *ot);
void WM_OT_alembic_export( wmOperatorType *ot);
void WM_OT_alembic_import( wmOperatorType *ot);

View File

@@ -10,9 +10,9 @@
struct wmOperatorType;
void CACHEFILE_OT_open(struct wmOperatorType *ot);
void CACHEFILE_OT_reload(struct wmOperatorType *ot);
void CACHEFILE_OT_open(wmOperatorType *ot);
void CACHEFILE_OT_reload(wmOperatorType *ot);
void CACHEFILE_OT_layer_add(struct wmOperatorType *ot);
void CACHEFILE_OT_layer_remove(struct wmOperatorType *ot);
void CACHEFILE_OT_layer_move(struct wmOperatorType *ot);
void CACHEFILE_OT_layer_add(wmOperatorType *ot);
void CACHEFILE_OT_layer_remove(wmOperatorType *ot);
void CACHEFILE_OT_layer_move(wmOperatorType *ot);

View File

@@ -10,5 +10,5 @@
struct wmOperatorType;
void WM_OT_collada_export(struct wmOperatorType *ot);
void WM_OT_collada_import(struct wmOperatorType *ot);
void WM_OT_collada_export( wmOperatorType *ot);
void WM_OT_collada_import( wmOperatorType *ot);

View File

@@ -13,14 +13,14 @@ struct View3D;
struct bContext;
struct wmOperatorType;
void WM_OT_gpencil_import_svg(struct wmOperatorType *ot);
void WM_OT_gpencil_import_svg(wmOperatorType *ot);
#ifdef WITH_PUGIXML
void WM_OT_gpencil_export_svg(struct wmOperatorType *ot);
void WM_OT_gpencil_export_svg(wmOperatorType *ot);
#endif
#ifdef WITH_HARU
void WM_OT_gpencil_export_pdf(struct wmOperatorType *ot);
void WM_OT_gpencil_export_pdf(wmOperatorType *ot);
#endif
struct ARegion *get_invoke_region(struct bContext *C);
struct View3D *get_invoke_view3d(struct bContext *C);
ARegion *get_invoke_region(bContext *C);
View3D *get_invoke_view3d(bContext *C);

View File

@@ -10,5 +10,5 @@
struct wmOperatorType;
void WM_OT_obj_export(struct wmOperatorType *ot);
void WM_OT_obj_import(struct wmOperatorType *ot);
void WM_OT_obj_export( wmOperatorType *ot);
void WM_OT_obj_import( wmOperatorType *ot);

View File

@@ -10,5 +10,5 @@
struct wmOperatorType;
void WM_OT_ply_export(struct wmOperatorType *ot);
void WM_OT_ply_import(struct wmOperatorType *ot);
void WM_OT_ply_export(wmOperatorType *ot);
void WM_OT_ply_import(wmOperatorType *ot);

View File

@@ -10,5 +10,5 @@
struct wmOperatorType;
void WM_OT_stl_export(struct wmOperatorType *ot);
void WM_OT_stl_import(struct wmOperatorType *ot);
void WM_OT_stl_export(wmOperatorType *ot);
void WM_OT_stl_import(wmOperatorType *ot);

View File

@@ -10,5 +10,5 @@
struct wmOperatorType;
void WM_OT_usd_export(struct wmOperatorType *ot);
void WM_OT_usd_import(struct wmOperatorType *ot);
void WM_OT_usd_export(wmOperatorType *ot);
void WM_OT_usd_import(wmOperatorType *ot);

View File

@@ -14,82 +14,82 @@ struct wmOperatorType;
/* `render_shading.cc` */
void OBJECT_OT_material_slot_add(struct wmOperatorType *ot);
void OBJECT_OT_material_slot_remove(struct wmOperatorType *ot);
void OBJECT_OT_material_slot_assign(struct wmOperatorType *ot);
void OBJECT_OT_material_slot_select(struct wmOperatorType *ot);
void OBJECT_OT_material_slot_deselect(struct wmOperatorType *ot);
void OBJECT_OT_material_slot_copy(struct wmOperatorType *ot);
void OBJECT_OT_material_slot_move(struct wmOperatorType *ot);
void OBJECT_OT_material_slot_remove_unused(struct wmOperatorType *ot);
void OBJECT_OT_material_slot_add(wmOperatorType *ot);
void OBJECT_OT_material_slot_remove(wmOperatorType *ot);
void OBJECT_OT_material_slot_assign(wmOperatorType *ot);
void OBJECT_OT_material_slot_select(wmOperatorType *ot);
void OBJECT_OT_material_slot_deselect(wmOperatorType *ot);
void OBJECT_OT_material_slot_copy(wmOperatorType *ot);
void OBJECT_OT_material_slot_move(wmOperatorType *ot);
void OBJECT_OT_material_slot_remove_unused(wmOperatorType *ot);
void MATERIAL_OT_new(struct wmOperatorType *ot);
void TEXTURE_OT_new(struct wmOperatorType *ot);
void WORLD_OT_new(struct wmOperatorType *ot);
void MATERIAL_OT_new(wmOperatorType *ot);
void TEXTURE_OT_new(wmOperatorType *ot);
void WORLD_OT_new(wmOperatorType *ot);
void MATERIAL_OT_copy(struct wmOperatorType *ot);
void MATERIAL_OT_paste(struct wmOperatorType *ot);
void MATERIAL_OT_copy(wmOperatorType *ot);
void MATERIAL_OT_paste(wmOperatorType *ot);
void SCENE_OT_view_layer_add(struct wmOperatorType *ot);
void SCENE_OT_view_layer_remove(struct wmOperatorType *ot);
void SCENE_OT_view_layer_add_aov(struct wmOperatorType *ot);
void SCENE_OT_view_layer_remove_aov(struct wmOperatorType *ot);
void SCENE_OT_view_layer_add_lightgroup(struct wmOperatorType *ot);
void SCENE_OT_view_layer_remove_lightgroup(struct wmOperatorType *ot);
void SCENE_OT_view_layer_add_used_lightgroups(struct wmOperatorType *ot);
void SCENE_OT_view_layer_remove_unused_lightgroups(struct wmOperatorType *ot);
void SCENE_OT_view_layer_add(wmOperatorType *ot);
void SCENE_OT_view_layer_remove(wmOperatorType *ot);
void SCENE_OT_view_layer_add_aov(wmOperatorType *ot);
void SCENE_OT_view_layer_remove_aov(wmOperatorType *ot);
void SCENE_OT_view_layer_add_lightgroup(wmOperatorType *ot);
void SCENE_OT_view_layer_remove_lightgroup(wmOperatorType *ot);
void SCENE_OT_view_layer_add_used_lightgroups(wmOperatorType *ot);
void SCENE_OT_view_layer_remove_unused_lightgroups(wmOperatorType *ot);
void SCENE_OT_light_cache_bake(struct wmOperatorType *ot);
void SCENE_OT_light_cache_free(struct wmOperatorType *ot);
void SCENE_OT_light_cache_bake(wmOperatorType *ot);
void SCENE_OT_light_cache_free(wmOperatorType *ot);
void OBJECT_OT_lightprobe_cache_bake(struct wmOperatorType *ot);
void OBJECT_OT_lightprobe_cache_free(struct wmOperatorType *ot);
void OBJECT_OT_lightprobe_cache_bake(wmOperatorType *ot);
void OBJECT_OT_lightprobe_cache_free(wmOperatorType *ot);
void SCENE_OT_render_view_add(struct wmOperatorType *ot);
void SCENE_OT_render_view_remove(struct wmOperatorType *ot);
void SCENE_OT_render_view_add(wmOperatorType *ot);
void SCENE_OT_render_view_remove(wmOperatorType *ot);
#ifdef WITH_FREESTYLE
void SCENE_OT_freestyle_module_add(struct wmOperatorType *ot);
void SCENE_OT_freestyle_module_remove(struct wmOperatorType *ot);
void SCENE_OT_freestyle_module_move(struct wmOperatorType *ot);
void SCENE_OT_freestyle_lineset_add(struct wmOperatorType *ot);
void SCENE_OT_freestyle_lineset_copy(struct wmOperatorType *ot);
void SCENE_OT_freestyle_lineset_paste(struct wmOperatorType *ot);
void SCENE_OT_freestyle_lineset_remove(struct wmOperatorType *ot);
void SCENE_OT_freestyle_lineset_move(struct wmOperatorType *ot);
void SCENE_OT_freestyle_linestyle_new(struct wmOperatorType *ot);
void SCENE_OT_freestyle_color_modifier_add(struct wmOperatorType *ot);
void SCENE_OT_freestyle_alpha_modifier_add(struct wmOperatorType *ot);
void SCENE_OT_freestyle_thickness_modifier_add(struct wmOperatorType *ot);
void SCENE_OT_freestyle_geometry_modifier_add(struct wmOperatorType *ot);
void SCENE_OT_freestyle_modifier_remove(struct wmOperatorType *ot);
void SCENE_OT_freestyle_modifier_move(struct wmOperatorType *ot);
void SCENE_OT_freestyle_modifier_copy(struct wmOperatorType *ot);
void SCENE_OT_freestyle_stroke_material_create(struct wmOperatorType *ot);
void SCENE_OT_freestyle_module_add(wmOperatorType *ot);
void SCENE_OT_freestyle_module_remove(wmOperatorType *ot);
void SCENE_OT_freestyle_module_move(wmOperatorType *ot);
void SCENE_OT_freestyle_lineset_add(wmOperatorType *ot);
void SCENE_OT_freestyle_lineset_copy(wmOperatorType *ot);
void SCENE_OT_freestyle_lineset_paste(wmOperatorType *ot);
void SCENE_OT_freestyle_lineset_remove(wmOperatorType *ot);
void SCENE_OT_freestyle_lineset_move(wmOperatorType *ot);
void SCENE_OT_freestyle_linestyle_new(wmOperatorType *ot);
void SCENE_OT_freestyle_color_modifier_add(wmOperatorType *ot);
void SCENE_OT_freestyle_alpha_modifier_add(wmOperatorType *ot);
void SCENE_OT_freestyle_thickness_modifier_add(wmOperatorType *ot);
void SCENE_OT_freestyle_geometry_modifier_add(wmOperatorType *ot);
void SCENE_OT_freestyle_modifier_remove(wmOperatorType *ot);
void SCENE_OT_freestyle_modifier_move(wmOperatorType *ot);
void SCENE_OT_freestyle_modifier_copy(wmOperatorType *ot);
void SCENE_OT_freestyle_stroke_material_create(wmOperatorType *ot);
#endif
void TEXTURE_OT_slot_copy(struct wmOperatorType *ot);
void TEXTURE_OT_slot_paste(struct wmOperatorType *ot);
void TEXTURE_OT_slot_move(struct wmOperatorType *ot);
void TEXTURE_OT_slot_copy(wmOperatorType *ot);
void TEXTURE_OT_slot_paste(wmOperatorType *ot);
void TEXTURE_OT_slot_move(wmOperatorType *ot);
/* `render_internal.cc` */
/**
* Contextual render, using current scene, view3d?
*/
void RENDER_OT_render(struct wmOperatorType *ot);
void RENDER_OT_shutter_curve_preset(struct wmOperatorType *ot);
void RENDER_OT_render(wmOperatorType *ot);
void RENDER_OT_shutter_curve_preset(wmOperatorType *ot);
/* `render_view.cc` */
/**
* New window uses x,y to set position.
*/
struct ScrArea *render_view_open(struct bContext *C, int mx, int my, struct ReportList *reports);
ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports);
void RENDER_OT_view_show(struct wmOperatorType *ot);
void RENDER_OT_view_cancel(struct wmOperatorType *ot);
void RENDER_OT_view_show(wmOperatorType *ot);
void RENDER_OT_view_cancel(wmOperatorType *ot);
/* `render_opengl.cc` */
void RENDER_OT_opengl(struct wmOperatorType *ot);
void RENDER_OT_opengl(wmOperatorType *ot);

View File

@@ -173,5 +173,5 @@ struct CurvesConstraintSolver {
} // namespace blender::ed::sculpt_paint
bool CURVES_SCULPT_mode_poll(struct bContext *C);
bool CURVES_SCULPT_mode_poll_view3d(struct bContext *C);
bool CURVES_SCULPT_mode_poll(bContext *C);
bool CURVES_SCULPT_mode_poll_view3d(bContext *C);

View File

@@ -47,6 +47,7 @@ struct PaintModeSettings;
struct WeightPaintInfo;
struct WPaintData;
struct wmKeyConfig;
struct wmKeyMap;
struct wmOperator;
struct wmOperatorType;
@@ -1698,7 +1699,7 @@ void SCULPT_OT_set_pivot_position(wmOperatorType *ot);
/* Mesh Filter. */
void SCULPT_OT_mesh_filter(wmOperatorType *ot);
struct wmKeyMap *filter_mesh_modal_keymap(struct wmKeyConfig *keyconf);
wmKeyMap *filter_mesh_modal_keymap(wmKeyConfig *keyconf);
/* Cloth Filter. */

View File

@@ -16,43 +16,43 @@ struct wmOperatorType;
/* `console_draw.cc` */
void console_textview_main(struct SpaceConsole *sc, const struct ARegion *region);
void console_textview_main(SpaceConsole *sc, const ARegion *region);
/* Needed to calculate the scroll-bar. */
int console_textview_height(struct SpaceConsole *sc, const struct ARegion *region);
int console_char_pick(struct SpaceConsole *sc, const struct ARegion *region, const int mval[2]);
int console_textview_height(SpaceConsole *sc, const ARegion *region);
int console_char_pick(SpaceConsole *sc, const ARegion *region, const int mval[2]);
void console_scrollback_prompt_begin(struct SpaceConsole *sc, ConsoleLine *cl_dummy);
void console_scrollback_prompt_end(struct SpaceConsole *sc, ConsoleLine *cl_dummy);
void console_scrollback_prompt_begin(SpaceConsole *sc, ConsoleLine *cl_dummy);
void console_scrollback_prompt_end(SpaceConsole *sc, ConsoleLine *cl_dummy);
/* `console_ops.cc` */
void console_history_free(SpaceConsole *sc, ConsoleLine *cl);
void console_scrollback_free(SpaceConsole *sc, ConsoleLine *cl);
ConsoleLine *console_history_add_str(struct SpaceConsole *sc, char *str, bool own);
ConsoleLine *console_scrollback_add_str(struct SpaceConsole *sc, char *str, bool own);
ConsoleLine *console_history_add_str(SpaceConsole *sc, char *str, bool own);
ConsoleLine *console_scrollback_add_str(SpaceConsole *sc, char *str, bool own);
ConsoleLine *console_history_verify(const struct bContext *C);
ConsoleLine *console_history_verify(const bContext *C);
void console_textview_update_rect(SpaceConsole *sc, ARegion *region);
void CONSOLE_OT_move(struct wmOperatorType *ot);
void CONSOLE_OT_delete(struct wmOperatorType *ot);
void CONSOLE_OT_insert(struct wmOperatorType *ot);
void CONSOLE_OT_move(wmOperatorType *ot);
void CONSOLE_OT_delete(wmOperatorType *ot);
void CONSOLE_OT_insert(wmOperatorType *ot);
void CONSOLE_OT_indent(struct wmOperatorType *ot);
void CONSOLE_OT_indent_or_autocomplete(struct wmOperatorType *ot);
void CONSOLE_OT_unindent(struct wmOperatorType *ot);
void CONSOLE_OT_indent(wmOperatorType *ot);
void CONSOLE_OT_indent_or_autocomplete(wmOperatorType *ot);
void CONSOLE_OT_unindent(wmOperatorType *ot);
void CONSOLE_OT_history_append(struct wmOperatorType *ot);
void CONSOLE_OT_scrollback_append(struct wmOperatorType *ot);
void CONSOLE_OT_history_append(wmOperatorType *ot);
void CONSOLE_OT_scrollback_append(wmOperatorType *ot);
void CONSOLE_OT_clear(struct wmOperatorType *ot);
void CONSOLE_OT_clear_line(struct wmOperatorType *ot);
void CONSOLE_OT_history_cycle(struct wmOperatorType *ot);
void CONSOLE_OT_copy(struct wmOperatorType *ot);
void CONSOLE_OT_paste(struct wmOperatorType *ot);
void CONSOLE_OT_select_set(struct wmOperatorType *ot);
void CONSOLE_OT_select_word(struct wmOperatorType *ot);
void CONSOLE_OT_clear(wmOperatorType *ot);
void CONSOLE_OT_clear_line(wmOperatorType *ot);
void CONSOLE_OT_history_cycle(wmOperatorType *ot);
void CONSOLE_OT_copy(wmOperatorType *ot);
void CONSOLE_OT_paste(wmOperatorType *ot);
void CONSOLE_OT_select_set(wmOperatorType *ot);
void CONSOLE_OT_select_word(wmOperatorType *ot);
enum { LINE_BEGIN, LINE_END, PREV_CHAR, NEXT_CHAR, PREV_WORD, NEXT_WORD };
enum {

View File

@@ -226,7 +226,7 @@ void file_path_to_ui_path(const char *path, char *r_pathi, int max_size);
/* C-handle for #ed::asset_browser::AssetCatalogFilterSettings. */
typedef struct FileAssetCatalogFilterSettingsHandle FileAssetCatalogFilterSettingsHandle;
void file_create_asset_catalog_tree_view_in_layout(AssetLibrary *asset_library,
void file_create_asset_catalog_tree_view_in_layout(::AssetLibrary *asset_library,
uiLayout *layout,
SpaceFile *space_file,
FileAssetSelectParams *params);
@@ -245,7 +245,7 @@ void file_delete_asset_catalog_filter_settings(
bool file_set_asset_catalog_filter_settings(
FileAssetCatalogFilterSettingsHandle *filter_settings_handle,
eFileSel_Params_AssetCatalogVisibility catalog_visibility,
bUUID catalog_id);
::bUUID catalog_id);
void file_ensure_updated_catalog_filter_data(
FileAssetCatalogFilterSettingsHandle *filter_settings_handle,
const blender::asset_system::AssetLibrary *asset_library);

View File

@@ -14,40 +14,36 @@ struct ReportList;
struct SpaceInfo;
struct wmOperatorType;
void FILE_OT_autopack_toggle(struct wmOperatorType *ot);
void FILE_OT_pack_all(struct wmOperatorType *ot);
void FILE_OT_unpack_all(struct wmOperatorType *ot);
void FILE_OT_unpack_item(struct wmOperatorType *ot);
void FILE_OT_pack_libraries(struct wmOperatorType *ot);
void FILE_OT_unpack_libraries(struct wmOperatorType *ot);
void FILE_OT_autopack_toggle(wmOperatorType *ot);
void FILE_OT_pack_all(wmOperatorType *ot);
void FILE_OT_unpack_all(wmOperatorType *ot);
void FILE_OT_unpack_item(wmOperatorType *ot);
void FILE_OT_pack_libraries(wmOperatorType *ot);
void FILE_OT_unpack_libraries(wmOperatorType *ot);
void FILE_OT_make_paths_relative(struct wmOperatorType *ot);
void FILE_OT_make_paths_absolute(struct wmOperatorType *ot);
void FILE_OT_report_missing_files(struct wmOperatorType *ot);
void FILE_OT_find_missing_files(struct wmOperatorType *ot);
void FILE_OT_make_paths_relative(wmOperatorType *ot);
void FILE_OT_make_paths_absolute(wmOperatorType *ot);
void FILE_OT_report_missing_files(wmOperatorType *ot);
void FILE_OT_find_missing_files(wmOperatorType *ot);
void INFO_OT_reports_display_update(struct wmOperatorType *ot);
void INFO_OT_reports_display_update(wmOperatorType *ot);
/* `info_draw.cc` */
void *info_text_pick(const struct SpaceInfo *sinfo,
const struct ARegion *region,
const struct ReportList *reports,
void *info_text_pick(const SpaceInfo *sinfo,
const ARegion *region,
const ReportList *reports,
int mouse_y);
int info_textview_height(const struct SpaceInfo *sinfo,
const struct ARegion *region,
const struct ReportList *reports);
void info_textview_main(const struct SpaceInfo *sinfo,
const struct ARegion *region,
const struct ReportList *reports);
int info_textview_height(const SpaceInfo *sinfo, const ARegion *region, const ReportList *reports);
void info_textview_main(const SpaceInfo *sinfo, const ARegion *region, const ReportList *reports);
/* `info_report.cc` */
int info_report_mask(const struct SpaceInfo *sinfo);
void INFO_OT_select_pick(struct wmOperatorType *ot); /* report selection */
void INFO_OT_select_all(struct wmOperatorType *ot);
void INFO_OT_select_box(struct wmOperatorType *ot);
int info_report_mask(const SpaceInfo *sinfo);
void INFO_OT_select_pick(wmOperatorType *ot); /* report selection */
void INFO_OT_select_all(wmOperatorType *ot);
void INFO_OT_select_box(wmOperatorType *ot);
void INFO_OT_report_replay(struct wmOperatorType *ot);
void INFO_OT_report_delete(struct wmOperatorType *ot);
void INFO_OT_report_copy(struct wmOperatorType *ot);
void INFO_OT_report_replay(wmOperatorType *ot);
void INFO_OT_report_delete(wmOperatorType *ot);
void INFO_OT_report_copy(wmOperatorType *ot);

View File

@@ -34,23 +34,23 @@ struct TextViewContext {
int scroll_ymin, scroll_ymax;
/* callbacks */
int (*begin)(struct TextViewContext *tvc);
void (*end)(struct TextViewContext *tvc);
int (*begin)(TextViewContext *tvc);
void (*end)(TextViewContext *tvc);
const void *arg1;
const void *arg2;
/* iterator */
int (*step)(struct TextViewContext *tvc);
void (*line_get)(struct TextViewContext *tvc, const char **r_line, int *r_len);
enum eTextViewContext_LineFlag (*line_data)(struct TextViewContext *tvc,
int (*step)(TextViewContext *tvc);
void (*line_get)(TextViewContext *tvc, const char **r_line, int *r_len);
enum eTextViewContext_LineFlag (*line_data)(TextViewContext *tvc,
uchar fg[4],
uchar bg[4],
int *r_icon,
uchar r_icon_fg[4],
uchar r_icon_bg[4]);
void (*draw_cursor)(struct TextViewContext *tvc, int cwidth, int columns);
void (*draw_cursor)(TextViewContext *tvc, int cwidth, int columns);
/* constant theme colors */
void (*const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4]);
void (*const_colors)(TextViewContext *tvc, unsigned char bg_sel[4]);
const void *iter;
int iter_index;
/** Used for internal multi-line iteration. */
@@ -68,7 +68,7 @@ struct TextViewContext {
* \param r_mval_pick_offset: The offset in bytes of the \a mval_init.
* Use for selection.
*/
int textview_draw(struct TextViewContext *tvc,
int textview_draw(TextViewContext *tvc,
bool do_draw,
const int mval_init[2],
void **r_mval_pick_item,

View File

@@ -313,7 +313,7 @@ void NODE_OT_link_viewer(wmOperatorType *ot);
void NODE_OT_insert_offset(wmOperatorType *ot);
struct wmKeyMap *node_link_modal_keymap(struct wmKeyConfig *keyconf);
wmKeyMap *node_link_modal_keymap(wmKeyConfig *keyconf);
/* node_edit.cc */

View File

@@ -8,6 +8,7 @@
#pragma once
struct AnimData;
struct ListBase;
namespace blender::ed::outliner {
@@ -15,6 +16,6 @@ namespace blender::ed::outliner {
const char *outliner_idcode_to_plural(short idcode);
void outliner_make_object_parent_hierarchy(ListBase *lb);
bool outliner_animdata_test(const struct AnimData *adt);
bool outliner_animdata_test(const AnimData *adt);
} // namespace blender::ed::outliner

View File

@@ -39,7 +39,7 @@ enum {
#define FMT_CONT_ALL \
(FMT_CONT_QUOTESINGLE | FMT_CONT_QUOTEDOUBLE | FMT_CONT_TRIPLE | FMT_CONT_COMMENT_C)
int flatten_string(const struct SpaceText *st, FlattenString *fs, const char *in);
int flatten_string(const SpaceText *st, FlattenString *fs, const char *in);
void flatten_string_free(FlattenString *fs);
/**
* Takes a string within `fs->buf` and returns its length.
@@ -66,7 +66,7 @@ void text_format_fill_ascii(const char **str_p, char **fmt_p, char type, int len
/* *** Generalize Formatting *** */
struct TextFormatType {
struct TextFormatType *next, *prev;
TextFormatType *next, *prev;
char (*format_identifier)(const char *string);
@@ -110,7 +110,7 @@ enum {
FMT_TYPE_DEFAULT = 'q',
};
TextFormatType *ED_text_format_get(struct Text *text);
TextFormatType *ED_text_format_get( Text *text);
void ED_text_format_register(TextFormatType *tft);
/* formatters */

View File

@@ -24,16 +24,16 @@ extern "C" {
/* `text_draw.cc` */
void draw_text_main(struct SpaceText *st, struct ARegion *region);
void draw_text_main(SpaceText *st, ARegion *region);
void text_update_line_edited(struct TextLine *line);
void text_update_edited(struct Text *text);
void text_update_character_width(struct SpaceText *st);
void text_update_line_edited(TextLine *line);
void text_update_edited(Text *text);
void text_update_character_width(SpaceText *st);
/**
* Takes an area instead of a region, use for listeners.
*/
void text_scroll_to_cursor__area(struct SpaceText *st, struct ScrArea *area, bool center);
void text_update_cursor_moved(struct bContext *C);
void text_scroll_to_cursor__area(SpaceText *st, ScrArea *area, bool center);
void text_update_cursor_moved(bContext *C);
/* Padding around line numbers in character widths. */
#define TXT_NUMCOL_PAD 1.0f
@@ -64,39 +64,28 @@ void text_update_cursor_moved(struct bContext *C);
#define TOOL_SUGG_LIST 0x01
int wrap_width(const struct SpaceText *st, struct ARegion *region);
int wrap_width(const SpaceText *st, ARegion *region);
/**
* Sets (offl, offc) for transforming (line, curs) to its wrapped position.
*/
void wrap_offset(const struct SpaceText *st,
struct ARegion *region,
struct TextLine *linein,
int cursin,
int *offl,
int *offc);
void wrap_offset(
const SpaceText *st, ARegion *region, TextLine *linein, int cursin, int *offl, int *offc);
/**
* cursin - mem, offc - view.
*/
void wrap_offset_in_line(const struct SpaceText *st,
struct ARegion *region,
struct TextLine *linein,
int cursin,
int *offl,
int *offc);
int text_get_char_pos(const struct SpaceText *st, const char *line, int cur);
void wrap_offset_in_line(
const SpaceText *st, ARegion *region, TextLine *linein, int cursin, int *offl, int *offc);
int text_get_char_pos(const SpaceText *st, const char *line, int cur);
void text_drawcache_tag_update(struct SpaceText *st, bool full);
void text_free_caches(struct SpaceText *st);
void text_drawcache_tag_update(SpaceText *st, bool full);
void text_free_caches(SpaceText *st);
bool text_do_suggest_select(struct SpaceText *st, struct ARegion *region, const int mval[2]);
bool text_do_suggest_select(SpaceText *st, ARegion *region, const int mval[2]);
void text_pop_suggest_list(void);
int text_get_visible_lines(const struct SpaceText *st, struct ARegion *region, const char *str);
int text_get_span_wrap(const struct SpaceText *st,
struct ARegion *region,
struct TextLine *from,
struct TextLine *to);
int text_get_total_lines(struct SpaceText *st, struct ARegion *region);
int text_get_visible_lines(const SpaceText *st, ARegion *region, const char *str);
int text_get_span_wrap(const SpaceText *st, ARegion *region, TextLine *from, TextLine *to);
int text_get_total_lines(SpaceText *st, ARegion *region);
/* `text_ops.cc` */
@@ -116,67 +105,67 @@ enum {
};
enum { DEL_NEXT_CHAR, DEL_PREV_CHAR, DEL_NEXT_WORD, DEL_PREV_WORD };
void TEXT_OT_new(struct wmOperatorType *ot);
void TEXT_OT_open(struct wmOperatorType *ot);
void TEXT_OT_reload(struct wmOperatorType *ot);
void TEXT_OT_unlink(struct wmOperatorType *ot);
void TEXT_OT_save(struct wmOperatorType *ot);
void TEXT_OT_save_as(struct wmOperatorType *ot);
void TEXT_OT_make_internal(struct wmOperatorType *ot);
void TEXT_OT_run_script(struct wmOperatorType *ot);
void TEXT_OT_refresh_pyconstraints(struct wmOperatorType *ot);
void TEXT_OT_new(wmOperatorType *ot);
void TEXT_OT_open(wmOperatorType *ot);
void TEXT_OT_reload(wmOperatorType *ot);
void TEXT_OT_unlink(wmOperatorType *ot);
void TEXT_OT_save(wmOperatorType *ot);
void TEXT_OT_save_as(wmOperatorType *ot);
void TEXT_OT_make_internal(wmOperatorType *ot);
void TEXT_OT_run_script(wmOperatorType *ot);
void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot);
void TEXT_OT_paste(struct wmOperatorType *ot);
void TEXT_OT_copy(struct wmOperatorType *ot);
void TEXT_OT_cut(struct wmOperatorType *ot);
void TEXT_OT_duplicate_line(struct wmOperatorType *ot);
void TEXT_OT_paste(wmOperatorType *ot);
void TEXT_OT_copy(wmOperatorType *ot);
void TEXT_OT_cut(wmOperatorType *ot);
void TEXT_OT_duplicate_line(wmOperatorType *ot);
void TEXT_OT_convert_whitespace(struct wmOperatorType *ot);
void TEXT_OT_comment_toggle(struct wmOperatorType *ot);
void TEXT_OT_unindent(struct wmOperatorType *ot);
void TEXT_OT_indent(struct wmOperatorType *ot);
void TEXT_OT_indent_or_autocomplete(struct wmOperatorType *ot);
void TEXT_OT_convert_whitespace(wmOperatorType *ot);
void TEXT_OT_comment_toggle(wmOperatorType *ot);
void TEXT_OT_unindent(wmOperatorType *ot);
void TEXT_OT_indent(wmOperatorType *ot);
void TEXT_OT_indent_or_autocomplete(wmOperatorType *ot);
void TEXT_OT_line_break(struct wmOperatorType *ot);
void TEXT_OT_insert(struct wmOperatorType *ot);
void TEXT_OT_line_break(wmOperatorType *ot);
void TEXT_OT_insert(wmOperatorType *ot);
void TEXT_OT_select_line(struct wmOperatorType *ot);
void TEXT_OT_select_all(struct wmOperatorType *ot);
void TEXT_OT_select_word(struct wmOperatorType *ot);
void TEXT_OT_select_line(wmOperatorType *ot);
void TEXT_OT_select_all(wmOperatorType *ot);
void TEXT_OT_select_word(wmOperatorType *ot);
void TEXT_OT_move_lines(struct wmOperatorType *ot);
void TEXT_OT_move_lines(wmOperatorType *ot);
void TEXT_OT_jump(struct wmOperatorType *ot);
void TEXT_OT_move(struct wmOperatorType *ot);
void TEXT_OT_move_select(struct wmOperatorType *ot);
void TEXT_OT_delete(struct wmOperatorType *ot);
void TEXT_OT_overwrite_toggle(struct wmOperatorType *ot);
void TEXT_OT_jump(wmOperatorType *ot);
void TEXT_OT_move(wmOperatorType *ot);
void TEXT_OT_move_select(wmOperatorType *ot);
void TEXT_OT_delete(wmOperatorType *ot);
void TEXT_OT_overwrite_toggle(wmOperatorType *ot);
void TEXT_OT_scroll(struct wmOperatorType *ot);
void TEXT_OT_scroll_bar(struct wmOperatorType *ot);
void TEXT_OT_selection_set(struct wmOperatorType *ot);
void TEXT_OT_cursor_set(struct wmOperatorType *ot);
void TEXT_OT_line_number(struct wmOperatorType *ot);
void TEXT_OT_scroll(wmOperatorType *ot);
void TEXT_OT_scroll_bar(wmOperatorType *ot);
void TEXT_OT_selection_set(wmOperatorType *ot);
void TEXT_OT_cursor_set(wmOperatorType *ot);
void TEXT_OT_line_number(wmOperatorType *ot);
/* find = find indicated text */
void TEXT_OT_find(struct wmOperatorType *ot);
void TEXT_OT_find_set_selected(struct wmOperatorType *ot);
void TEXT_OT_replace(struct wmOperatorType *ot);
void TEXT_OT_replace_set_selected(struct wmOperatorType *ot);
void TEXT_OT_jump_to_file_at_point_internal(struct wmOperatorType *ot);
void TEXT_OT_find(wmOperatorType *ot);
void TEXT_OT_find_set_selected(wmOperatorType *ot);
void TEXT_OT_replace(wmOperatorType *ot);
void TEXT_OT_replace_set_selected(wmOperatorType *ot);
void TEXT_OT_jump_to_file_at_point_internal(wmOperatorType *ot);
/* text_find = open properties, activate search button */
void TEXT_OT_start_find(struct wmOperatorType *ot);
void TEXT_OT_start_find(wmOperatorType *ot);
void TEXT_OT_to_3d_object(struct wmOperatorType *ot);
void TEXT_OT_to_3d_object(wmOperatorType *ot);
void TEXT_OT_resolve_conflict(struct wmOperatorType *ot);
void TEXT_OT_resolve_conflict(wmOperatorType *ot);
bool text_space_edit_poll(struct bContext *C);
bool text_space_edit_poll(bContext *C);
/* `text_autocomplete.cc` */
void TEXT_OT_autocomplete(struct wmOperatorType *ot);
void TEXT_OT_autocomplete(wmOperatorType *ot);
/* `space_text.cc` */

View File

@@ -24,12 +24,16 @@ struct Scene;
struct ScrArea;
struct View3D;
struct bContext;
struct Object;
struct PointerRNA;
struct rcti;
struct wmEvent;
struct wmKeyConfig;
struct wmKeyMap;
struct wmOperator;
struct wmOperatorType;
struct wmTimer;
struct wmWindow;
struct wmWindowManager;
enum eV3D_OpPropFlag {
@@ -304,7 +308,7 @@ extern const ViewOpsType ViewOpsType_rotate;
* Each of the struct members may be NULL to signify they aren't to be adjusted.
*/
struct V3D_SmoothParams {
struct Object *camera_old, *camera;
Object *camera_old, *camera;
const float *ofs, *quat, *dist, *lens;
/** Alternate rotation center, when set `ofs` must be NULL. */

View File

@@ -15,4 +15,4 @@ struct UndoType;
/* memfile_undo.cc */
/** Export for ED_undo_sys. */
void ED_memfile_undosys_type(struct UndoType *ut);
void ED_memfile_undosys_type(UndoType *ut);

View File

@@ -47,7 +47,7 @@ class GLTexture : public Texture {
/** opengl identifier for texture. */
GLuint tex_id_ = 0;
/** Legacy workaround for texture copy. Created when using framebuffer_get(). */
struct GPUFrameBuffer *framebuffer_ = nullptr;
GPUFrameBuffer *framebuffer_ = nullptr;
/** True if this texture is bound to at least one texture unit. */
/* TODO(fclem): How do we ensure thread safety here? */
bool is_bound_ = false;

View File

@@ -26,7 +26,7 @@ class GLVertBuf : public VertBuf {
/** OpenGL buffer handle. Init on first upload. Immutable after that. */
GLuint vbo_id_ = 0;
/** Texture used if the buffer is bound as buffer texture. Init on first use. */
struct ::GPUTexture *buffer_texture_ = nullptr;
::GPUTexture *buffer_texture_ = nullptr;
/** Defines whether the buffer handle is wrapped by this GLVertBuf, i.e. we do not own it and
* should not free it. */
bool is_wrapper_ = false;

View File

@@ -24,7 +24,7 @@ class GPUTest : public ::testing::Test {
eGPUBackendType gpu_backend_type;
GHOST_SystemHandle ghost_system;
GHOST_ContextHandle ghost_context;
struct GPUContext *context;
GPUContext *context;
int32_t prev_g_debug_;

View File

@@ -46,18 +46,18 @@ class GpencilIO {
/* Used for sorting objects. */
struct ObjectZ {
float zdepth;
struct Object *ob;
Object *ob;
};
/** List of included objects. */
blender::Vector<ObjectZ> ob_list_;
/* Data for easy access. */
struct Depsgraph *depsgraph_;
struct bGPdata *gpd_;
struct Main *bmain_;
struct Scene *scene_;
struct RegionView3D *rv3d_;
Depsgraph *depsgraph_;
bGPdata *gpd_;
Main *bmain_;
Scene *scene_;
RegionView3D *rv3d_;
int winx_, winy_;
int render_x_, render_y_;
@@ -79,7 +79,7 @@ class GpencilIO {
float2 gpencil_3D_point_to_2D(const float3 co);
/** Get radius of point. */
float stroke_point_radius_get(struct bGPDlayer *gpl, struct bGPDstroke *gps);
float stroke_point_radius_get(bGPDlayer *gpl, bGPDstroke *gps);
/** Create a list of selected objects sorted from back to front */
void create_object_list();
@@ -87,8 +87,8 @@ class GpencilIO {
float stroke_average_opacity_get();
void prepare_layer_export_matrix(struct Object *ob, struct bGPDlayer *gpl);
void prepare_stroke_export_colors(struct Object *ob, struct bGPDstroke *gps);
void prepare_layer_export_matrix(Object *ob, bGPDlayer *gpl);
void prepare_stroke_export_colors(Object *ob, bGPDstroke *gps);
/* Calculate selected strokes boundbox. */
void selected_objects_boundbox_calc();

View File

@@ -13,7 +13,7 @@ namespace blender::io::gpencil {
class GpencilExporter : public GpencilIO {
public:
GpencilExporter(const struct GpencilIOParams *iparams) : GpencilIO(iparams){};
GpencilExporter(const GpencilIOParams *iparams) : GpencilIO(iparams){};
virtual bool write() = 0;
protected:

View File

@@ -22,7 +22,7 @@ namespace blender::io::gpencil {
class GpencilExporterPDF : public GpencilExporter {
public:
GpencilExporterPDF(const char *filepath, const struct GpencilIOParams *iparams);
GpencilExporterPDF(const char *filepath, const GpencilIOParams *iparams);
bool new_document();
bool add_newpage();
bool add_body();

View File

@@ -21,7 +21,7 @@ namespace blender::io::gpencil {
class GpencilExporterSVG : public GpencilExporter {
public:
GpencilExporterSVG(const char *filepath, const struct GpencilIOParams *iparams);
GpencilExporterSVG(const char *filepath, const GpencilIOParams *iparams);
bool add_newpage();
bool add_body();
bool write();
@@ -74,8 +74,8 @@ class GpencilExporterSVG : public GpencilExporter {
* \param node_gpl: Node of the layer.
* \param do_fill: True if the stroke is only fill
*/
void export_stroke_to_path(struct bGPDlayer *gpl,
struct bGPDstroke *gps,
void export_stroke_to_path(bGPDlayer *gpl,
bGPDstroke *gps,
pugi::xml_node node_gpl,
bool do_fill);
@@ -84,21 +84,15 @@ class GpencilExporterSVG : public GpencilExporter {
* \param node_gpl: Node of the layer.
* \param do_fill: True if the stroke is only fill
*/
void export_stroke_to_polyline(struct bGPDlayer *gpl,
struct bGPDstroke *gps,
pugi::xml_node node_gpl,
bool is_stroke,
bool do_fill);
void export_stroke_to_polyline(
bGPDlayer *gpl, bGPDstroke *gps, pugi::xml_node node_gpl, bool is_stroke, bool do_fill);
/**
* Set color SVG string for stroke
* \param node_gps: Stroke node.
* \param do_fill: True if the stroke is only fill.
*/
void color_string_set(struct bGPDlayer *gpl,
struct bGPDstroke *gps,
pugi::xml_node node_gps,
bool do_fill);
void color_string_set(bGPDlayer *gpl, bGPDstroke *gps, pugi::xml_node node_gps, bool do_fill);
/** Convert a color to Hex value (#FFFFFF). */
std::string rgb_to_hexstr(const float color[3]);

View File

@@ -13,11 +13,11 @@ namespace blender::io::gpencil {
class GpencilImporter : public GpencilIO {
public:
GpencilImporter(const struct GpencilIOParams *iparams);
GpencilImporter(const GpencilIOParams *iparams);
virtual bool read() = 0;
protected:
struct Object *create_object();
Object *create_object();
int32_t create_material(const char *name, bool stroke, bool fill);
private:

View File

@@ -22,16 +22,16 @@ namespace blender::io::gpencil {
class GpencilImporterSVG : public GpencilImporter {
public:
GpencilImporterSVG(const char *filepath, const struct GpencilIOParams *iparams);
GpencilImporterSVG(const char *filepath, const GpencilIOParams *iparams);
bool read();
protected:
private:
void create_stroke(struct bGPdata *gpd_,
struct bGPDframe *gpf,
struct NSVGshape *shape,
struct NSVGpath *path,
void create_stroke(bGPdata *gpd_,
bGPDframe *gpf,
NSVGshape *shape,
NSVGpath *path,
int32_t mat_index,
const float matrix[4][4]);

View File

@@ -77,7 +77,7 @@
} \
\
[[maybe_unused]] static void rna_Mesh_##collection_name##_##active_type##_set( \
PointerRNA *ptr, PointerRNA value, struct ReportList *) \
PointerRNA *ptr, PointerRNA value, ReportList *) \
{ \
Mesh *me = rna_mesh(ptr); \
CustomData *data = rna_mesh_##customdata_type(ptr); \

View File

@@ -19,7 +19,7 @@ class GeoModifierLog;
* inputs. If any properties correspond to the old properties by name and type, carry over
* the values.
*/
void MOD_nodes_update_interface(struct Object *object, struct NodesModifierData *nmd);
void MOD_nodes_update_interface(Object *object, NodesModifierData *nmd);
namespace blender {

View File

@@ -20,8 +20,8 @@
#define CMP_SCALE_MAX 12000
bool cmp_node_poll_default(const struct bNodeType *ntype,
const struct bNodeTree *ntree,
bool cmp_node_poll_default(const bNodeType *ntype,
const bNodeTree *ntree,
const char **r_disabled_hint);
void cmp_node_update_default(struct bNodeTree *ntree, struct bNode *node);
void cmp_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass);
void cmp_node_update_default(bNodeTree *ntree, bNode *node);
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass);

View File

@@ -25,4 +25,4 @@
#include "RNA_access.h"
void fn_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass);
void fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass);

View File

@@ -33,9 +33,9 @@
struct BVHTreeFromMesh;
void geo_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass);
bool geo_node_poll_default(const struct bNodeType *ntype,
const struct bNodeTree *ntree,
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass);
bool geo_node_poll_default(const bNodeType *ntype,
const bNodeTree *ntree,
const char **r_disabled_hint);
namespace blender::nodes {

View File

@@ -53,7 +53,7 @@ struct bNodeThreadStack {
};
/** For a given socket, find the actual stack entry. */
bNodeStack *node_get_socket_stack(struct bNodeStack *stack, struct bNodeSocket *sock);
bNodeStack *node_get_socket_stack(bNodeStack *stack, bNodeSocket *sock);
void node_get_stack(bNode *node, bNodeStack *stack, bNodeStack **in, bNodeStack **out);
bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context,

View File

@@ -62,16 +62,16 @@
#include "RNA_access.h"
bool sh_node_poll_default(const struct bNodeType *ntype,
const struct bNodeTree *ntree,
bool sh_node_poll_default(const bNodeType *ntype,
const bNodeTree *ntree,
const char **r_disabled_hint);
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass);
void sh_fn_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass);
bool line_style_shader_nodes_poll(const struct bContext *C);
bool world_shader_nodes_poll(const struct bContext *C);
bool object_shader_nodes_poll(const struct bContext *C);
bool object_cycles_shader_nodes_poll(const struct bContext *C);
bool object_eevee_shader_nodes_poll(const struct bContext *C);
void sh_node_type_base(bNodeType *ntype, int type, const char *name, short nclass);
void sh_fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass);
bool line_style_shader_nodes_poll(const bContext *C);
bool world_shader_nodes_poll(const bContext *C);
bool object_shader_nodes_poll(const bContext *C);
bool object_cycles_shader_nodes_poll(const bContext *C);
bool object_eevee_shader_nodes_poll(const bContext *C);
/* ********* exec data struct, remains internal *********** */
@@ -80,25 +80,19 @@ struct XYZ_to_RGB /* Transposed #imbuf_xyz_to_rgb, passed as 3x vec3. */
float r[3], g[3], b[3];
};
void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, struct bNodeStack *ns);
void node_data_from_gpu_stack(struct bNodeStack *ns, struct GPUNodeStack *gs);
void node_shader_gpu_bump_tex_coord(struct GPUMaterial *mat,
struct bNode *node,
struct GPUNodeLink **link);
void node_shader_gpu_default_tex_coord(struct GPUMaterial *mat,
struct bNode *node,
struct GPUNodeLink **link);
void node_shader_gpu_tex_mapping(struct GPUMaterial *mat,
struct bNode *node,
struct GPUNodeStack *in,
struct GPUNodeStack *out);
void node_gpu_stack_from_data(GPUNodeStack *gs, int type, bNodeStack *ns);
void node_data_from_gpu_stack(bNodeStack *ns, GPUNodeStack *gs);
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link);
void node_shader_gpu_default_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link);
void node_shader_gpu_tex_mapping(GPUMaterial *mat,
bNode *node,
GPUNodeStack *in,
GPUNodeStack *out);
struct bNodeTreeExec *ntreeShaderBeginExecTree_internal(struct bNodeExecContext *context,
struct bNodeTree *ntree,
bNodeInstanceKey parent_key);
void ntreeShaderEndExecTree_internal(struct bNodeTreeExec *exec);
bNodeTreeExec *ntreeShaderBeginExecTree_internal(bNodeExecContext *context,
bNodeTree *ntree,
bNodeInstanceKey parent_key);
void ntreeShaderEndExecTree_internal(bNodeTreeExec *exec);
void ntreeExecGPUNodes(struct bNodeTreeExec *exec,
struct GPUMaterial *mat,
struct bNode *output_node);
void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, bNode *output_node);
void get_XYZ_to_RGB_for_gpu(XYZ_to_RGB *data);

View File

@@ -54,7 +54,9 @@
extern "C" {
#endif
typedef struct TexCallData {
struct bNodeThreadStack;
struct TexCallData {
TexResult *target;
/* all float[3] */
const float *co;
@@ -68,9 +70,9 @@ typedef struct TexCallData {
int cfra;
MTex *mtex;
} TexCallData;
};
typedef struct TexParams {
struct TexParams {
const float *co;
float *dxt, *dyt;
const float *previewco;
@@ -80,23 +82,23 @@ typedef struct TexParams {
/* optional. we don't really want these here, but image
* textures need to do mapping & color correction */
MTex *mtex;
} TexParams;
};
typedef void (*TexFn)(float *out, TexParams *params, bNode *node, bNodeStack **in, short thread);
typedef struct TexDelegate {
struct TexDelegate {
TexCallData *cdata;
TexFn fn;
bNode *node;
bNodePreview *preview;
bNodeStack *in[MAX_SOCKET];
int type;
} TexDelegate;
};
bool tex_node_poll_default(const struct bNodeType *ntype,
const struct bNodeTree *ntree,
bool tex_node_poll_default(const bNodeType *ntype,
const bNodeTree *ntree,
const char **r_disabled_hint);
void tex_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass);
void tex_node_type_base(bNodeType *ntype, int type, const char *name, short nclass);
void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread);
void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread);
@@ -111,17 +113,17 @@ void tex_output(bNode *node,
void params_from_cdata(TexParams *out, TexCallData *in);
struct bNodeThreadStack *ntreeGetThreadStack(struct bNodeTreeExec *exec, int thread);
void ntreeReleaseThreadStack(struct bNodeThreadStack *nts);
bool ntreeExecThreadNodes(struct bNodeTreeExec *exec,
struct bNodeThreadStack *nts,
bNodeThreadStack *ntreeGetThreadStack(bNodeTreeExec *exec, int thread);
void ntreeReleaseThreadStack(bNodeThreadStack *nts);
bool ntreeExecThreadNodes(bNodeTreeExec *exec,
bNodeThreadStack *nts,
void *callerdata,
int thread);
struct bNodeTreeExec *ntreeTexBeginExecTree_internal(struct bNodeExecContext *context,
struct bNodeTree *ntree,
bNodeInstanceKey parent_key);
void ntreeTexEndExecTree_internal(struct bNodeTreeExec *exec);
bNodeTreeExec *ntreeTexBeginExecTree_internal(bNodeExecContext *context,
bNodeTree *ntree,
bNodeInstanceKey parent_key);
void ntreeTexEndExecTree_internal(bNodeTreeExec *exec);
#ifdef __cplusplus
}