add roundness/aspect jitter
This commit is contained in:
12
src/abr.cpp
12
src/abr.cpp
@@ -161,12 +161,12 @@ 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'
|
||||
|
||||
auto jitter_size = p->get<Descriptor>("szVr");
|
||||
if (jitter_size)
|
||||
if (auto jitter_size = p->get<Descriptor>("szVr"))
|
||||
{
|
||||
b->m_jitter_scale = jitter_size->value<UnitFloat>("jitter") * 0.01f;
|
||||
// TODO: p->value<UnitFloat>("minimumDiameter") * 0.001f; // minimum size
|
||||
@@ -174,8 +174,7 @@ std::vector<std::shared_ptr<Brush>> ABR::compute_brushes(const std::string& path
|
||||
b->m_tip_size_pressure = true;
|
||||
}
|
||||
|
||||
auto jitter_angle = p->get<Descriptor>("angleDynamics");
|
||||
if (jitter_angle)
|
||||
if (auto jitter_angle = p->get<Descriptor>("angleDynamics"))
|
||||
{
|
||||
auto mode = jitter_angle->value<Integer>("bVTy");
|
||||
if (mode == 0)
|
||||
@@ -194,6 +193,11 @@ std::vector<std::shared_ptr<Brush>> ABR::compute_brushes(const std::string& path
|
||||
}
|
||||
}
|
||||
|
||||
if (auto roundness = p->get<Descriptor>("roundnessDynamics"))
|
||||
{
|
||||
b->m_jitter_aspect = (1.f - roundness->value<UnitFloat>("jitter") * 0.01) * 0.5f + 0.5f;
|
||||
}
|
||||
|
||||
b->m_tip_randflipx = p->value<Boolean>("flipX");
|
||||
b->m_tip_randflipy = p->value<Boolean>("flipY");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user