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
|
// Shape dynamics
|
||||||
if (p->value<Boolean>("useTipDynamics"))
|
if (p->value<Boolean>("useTipDynamics"))
|
||||||
{
|
{
|
||||||
// other properties 'brushProjection', 'minimumRoundness', 'roundnessDynamics', 'tiltScale'
|
// other properties 'brushProjection', 'minimumRoundness', 'tiltScale'
|
||||||
|
|
||||||
if (auto jitter_size = p->get<Descriptor>("szVr"))
|
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
|
// Transfer settings
|
||||||
if (p->value<Boolean>("usePaintDynamics"))
|
if (p->value<Boolean>("usePaintDynamics"))
|
||||||
{
|
{
|
||||||
// TODO: implement this when opacity is per-sample
|
auto jitter_opacity = p->get<Descriptor>("opVr");
|
||||||
//auto jitter_opacity = p->get<Descriptor>("opVr");
|
if (jitter_opacity)
|
||||||
//if (jitter_opacity)
|
{
|
||||||
//{
|
b->m_jitter_opacity = jitter_opacity->value<UnitFloat>("jitter") * 0.01f;
|
||||||
// b->m_jitter_opacity = jitter_opacity->value<UnitFloat>("jitter") * 0.01f;
|
// TODO: jitter_opacity->value<UnitFloat>("Mnm ") * 0.01f; // minimum size
|
||||||
// // TODO: jitter_opacity->value<UnitFloat>("Mnm ") * 0.01f; // minimum size
|
if (jitter_opacity->value<Integer>("bVTy") == 2)
|
||||||
// if (jitter_opacity->value<Integer>("bVTy") == 2)
|
b->m_tip_opacity_pressure = true;
|
||||||
// b->m_tip_opacity_pressure;
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
auto jitter_flow = p->get<Descriptor>("prVr");
|
auto jitter_flow = p->get<Descriptor>("prVr");
|
||||||
if (jitter_flow)
|
if (jitter_flow)
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ public:
|
|||||||
class NodePanelBrushPreset : public Node
|
class NodePanelBrushPreset : public Node
|
||||||
{
|
{
|
||||||
NodeBrushPresetItem* m_current = nullptr;
|
NodeBrushPresetItem* m_current = nullptr;
|
||||||
Node* m_container;
|
|
||||||
NodeButtonCustom* m_btn_add;
|
NodeButtonCustom* m_btn_add;
|
||||||
NodeButtonCustom* m_btn_up;
|
NodeButtonCustom* m_btn_up;
|
||||||
NodeButtonCustom* m_btn_down;
|
NodeButtonCustom* m_btn_down;
|
||||||
@@ -171,6 +170,7 @@ class NodePanelBrushPreset : public Node
|
|||||||
float m_pattern_depth = 1.f;
|
float m_pattern_depth = 1.f;
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
|
Node* m_container;
|
||||||
std::function<void(Node* target, std::shared_ptr<Brush>& brush)> on_brush_changed;
|
std::function<void(Node* target, std::shared_ptr<Brush>& brush)> on_brush_changed;
|
||||||
std::function<void(Node* target)> on_popup_close;
|
std::function<void(Node* target)> on_popup_close;
|
||||||
virtual Node* clone_instantiate() const override;
|
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_follow->checked = b->m_tip_angle_follow;
|
||||||
m_tip_angle_init->checked = b->m_tip_angle_init;
|
m_tip_angle_init->checked = b->m_tip_angle_init;
|
||||||
m_tip_flow_pressure->checked = b->m_tip_flow_pressure;
|
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_tip_size_pressure->checked = b->m_tip_size_pressure;
|
||||||
m_jitter_aspect_bothaxis->checked = b->m_jitter_aspect_bothaxis;
|
m_jitter_aspect_bothaxis->checked = b->m_jitter_aspect_bothaxis;
|
||||||
|
|
||||||
@@ -281,6 +282,8 @@ void NodePanelStroke::init_controls()
|
|||||||
tick->SetSize(16, 32);
|
tick->SetSize(16, 32);
|
||||||
tick->SetPosition(pos.x, pos.y + (m_preset_button->m_size.y - 32) * 0.5f);
|
tick->SetPosition(pos.x, pos.y + (m_preset_button->m_size.y - 32) * 0.5f);
|
||||||
tick->set_image("data/ui/popup-tick.png");
|
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();
|
root()->update();
|
||||||
if ((pos.y + m_presets_popup->m_size.y) > screen.y)
|
if ((pos.y + m_presets_popup->m_size.y) > screen.y)
|
||||||
pos.y = screen.y - m_presets_popup->m_size.y;
|
pos.y = screen.y - m_presets_popup->m_size.y;
|
||||||
|
|||||||
Reference in New Issue
Block a user