abr opacity jitter value, longer presets popup
This commit is contained in:
19
src/abr.cpp
19
src/abr.cpp
@@ -164,7 +164,7 @@ std::vector<std::shared_ptr<Brush>> ABR::compute_brushes(const std::string& path
|
||||
// Shape dynamics
|
||||
if (p->value<Boolean>("useTipDynamics"))
|
||||
{
|
||||
// other properties 'brushProjection', 'minimumRoundness', 'roundnessDynamics', 'tiltScale'
|
||||
// other properties 'brushProjection', 'minimumRoundness', 'tiltScale'
|
||||
|
||||
if (auto jitter_size = p->get<Descriptor>("szVr"))
|
||||
{
|
||||
@@ -205,15 +205,14 @@ std::vector<std::shared_ptr<Brush>> ABR::compute_brushes(const std::string& path
|
||||
// Transfer settings
|
||||
if (p->value<Boolean>("usePaintDynamics"))
|
||||
{
|
||||
// TODO: implement this when opacity is per-sample
|
||||
//auto jitter_opacity = p->get<Descriptor>("opVr");
|
||||
//if (jitter_opacity)
|
||||
//{
|
||||
// b->m_jitter_opacity = jitter_opacity->value<UnitFloat>("jitter") * 0.01f;
|
||||
// // TODO: jitter_opacity->value<UnitFloat>("Mnm ") * 0.01f; // minimum size
|
||||
// if (jitter_opacity->value<Integer>("bVTy") == 2)
|
||||
// b->m_tip_opacity_pressure;
|
||||
//}
|
||||
auto jitter_opacity = p->get<Descriptor>("opVr");
|
||||
if (jitter_opacity)
|
||||
{
|
||||
b->m_jitter_opacity = jitter_opacity->value<UnitFloat>("jitter") * 0.01f;
|
||||
// TODO: jitter_opacity->value<UnitFloat>("Mnm ") * 0.01f; // minimum size
|
||||
if (jitter_opacity->value<Integer>("bVTy") == 2)
|
||||
b->m_tip_opacity_pressure = true;
|
||||
}
|
||||
|
||||
auto jitter_flow = p->get<Descriptor>("prVr");
|
||||
if (jitter_flow)
|
||||
|
||||
@@ -80,7 +80,6 @@ public:
|
||||
class NodePanelBrushPreset : public Node
|
||||
{
|
||||
NodeBrushPresetItem* m_current = nullptr;
|
||||
Node* m_container;
|
||||
NodeButtonCustom* m_btn_add;
|
||||
NodeButtonCustom* m_btn_up;
|
||||
NodeButtonCustom* m_btn_down;
|
||||
@@ -171,6 +170,7 @@ class NodePanelBrushPreset : public Node
|
||||
float m_pattern_depth = 1.f;
|
||||
};
|
||||
public:
|
||||
Node* m_container;
|
||||
std::function<void(Node* target, std::shared_ptr<Brush>& brush)> on_brush_changed;
|
||||
std::function<void(Node* target)> on_popup_close;
|
||||
virtual Node* clone_instantiate() const override;
|
||||
|
||||
@@ -168,6 +168,7 @@ void NodePanelStroke::update_controls()
|
||||
m_tip_angle_follow->checked = b->m_tip_angle_follow;
|
||||
m_tip_angle_init->checked = b->m_tip_angle_init;
|
||||
m_tip_flow_pressure->checked = b->m_tip_flow_pressure;
|
||||
m_tip_opacity_pressure->checked = b->m_tip_opacity_pressure;
|
||||
m_tip_size_pressure->checked = b->m_tip_size_pressure;
|
||||
m_jitter_aspect_bothaxis->checked = b->m_jitter_aspect_bothaxis;
|
||||
|
||||
@@ -281,6 +282,8 @@ void NodePanelStroke::init_controls()
|
||||
tick->SetSize(16, 32);
|
||||
tick->SetPosition(pos.x, pos.y + (m_preset_button->m_size.y - 32) * 0.5f);
|
||||
tick->set_image("data/ui/popup-tick.png");
|
||||
float hh = m_presets_popup->m_container->m_children.size() > 10 ? App::I.height * .75f : 400.f;
|
||||
m_presets_popup->SetSize(300, glm::max(hh, 400.f));
|
||||
root()->update();
|
||||
if ((pos.y + m_presets_popup->m_size.y) > screen.y)
|
||||
pos.y = screen.y - m_presets_popup->m_size.y;
|
||||
|
||||
Reference in New Issue
Block a user