Custom gumball: constrain scale to be uniform? (C++)

Hi,

I have a question from @dale’s sample SampleGumball: how can I constrain CRhinoGumball to have uniform scaling?

I tried this: in rhinoSdkGumball.h, CRhinoGumballDragSettings has a public member

  // Scale lock:
  // If scaling is occuring, m_scale_mode determines if
  // dragging one scale grip should be applied to other
  // scale directions.
  int m_scale_mode; // 0 free, 1 x=y, 2 y=z, 3 z=x, 4 x=y=z

So, in SampleGumball after declaring CRhinoGumball gb I modified/added the lines:

// Turn on scale
gb.m_appearance.m_bEnableXScale = true;
gb.m_appearance.m_bEnableYScale = true;
gb.m_appearance.m_bEnableZScale = true;

CRhinoGumballDisplayConduit dc;
dc.m_drag_settings.m_scale_mode = 4; //x=y=z

Though, it does not work for me…

Pablo

Hi @pagarcia,

I believe you are looking for CRhinoGumballFrame::m_scale_mode.

– Dale

That worked! Thank you @dale

Pablo