The old name `modifier_panel_end` was not great because: * There is no corresponding `*_begin`. * It sounds more magical then it really is (it just draws the error message). * It doesn't even have to be at the end as is sometimes the case when there are subpanels. Pull Request: https://projects.blender.org/blender/blender/pulls/138797
66 lines
1.9 KiB
C++
66 lines
1.9 KiB
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup modifiers
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <optional>
|
|
|
|
#include "BLI_string_ref.hh"
|
|
|
|
/* so modifier types match their defines */
|
|
#include "MOD_modifiertypes.hh"
|
|
|
|
#include "DEG_depsgraph_build.hh"
|
|
|
|
struct ARegionType;
|
|
struct Panel;
|
|
struct PanelType;
|
|
struct PointerRNA;
|
|
struct bContext;
|
|
struct uiLayout;
|
|
|
|
using PanelDrawFn = void (*)(const bContext *, Panel *);
|
|
|
|
/**
|
|
* Helper function for modifier layouts to draw vertex group settings.
|
|
*/
|
|
void modifier_vgroup_ui(uiLayout *layout,
|
|
PointerRNA *ptr,
|
|
PointerRNA *ob_ptr,
|
|
blender::StringRefNull vgroup_prop,
|
|
std::optional<blender::StringRefNull> invert_vgroup_prop,
|
|
std::optional<blender::StringRefNull> text);
|
|
|
|
void modifier_grease_pencil_curve_header_draw(const bContext * /*C*/, Panel *panel);
|
|
void modifier_grease_pencil_curve_panel_draw(const bContext * /*C*/, Panel *panel);
|
|
|
|
/**
|
|
* Draw modifier error message.
|
|
*/
|
|
void modifier_error_message_draw(uiLayout *layout, PointerRNA *ptr);
|
|
|
|
PointerRNA *modifier_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_ptr);
|
|
|
|
/**
|
|
* Create a panel in the context's region
|
|
*/
|
|
PanelType *modifier_panel_register(ARegionType *region_type, ModifierType type, PanelDrawFn draw);
|
|
|
|
/**
|
|
* Add a child panel to the parent.
|
|
*
|
|
* \note To create the panel type's #PanelType.idname,
|
|
* it appends the \a name argument to the \a parent's `idname`.
|
|
*/
|
|
PanelType *modifier_subpanel_register(ARegionType *region_type,
|
|
const char *name,
|
|
const char *label,
|
|
PanelDrawFn draw_header,
|
|
PanelDrawFn draw,
|
|
PanelType *parent);
|