Hi,
I want to implement a texture scaling command that has real-time draw/preview feedback similar to how other transform commands work - scale, rotate etc. that provide a real-time feedback with mouse events.
Currently, I am scaling a texture (which i fetch from a selected object) using the SetRepeat method but with simple command line inputs to get the U and V values for scaling the texture. I can then use those values to create the scaling vector required.
Select object with Get() → Retrieve RenderMaterial → Then RenderTexture() → SetRepeat()
public virtual void SetRepeat(
Vector3d value,
ChangeContexts changeContext
)
I had a look at the example command files on how to implement dynamic draw.
As far as I can understand, TransformObjects is reponsible for dynamic draw but the TransformObjectList only holds Rhino objects and grips (not textures). There is also the issue of how to apply texture scaling with transform but I might be missing something there. (assuming texture scaling can only be done with SetRepeat).
.
Is there any way/method with Transform commands that can implement dynamic draw on texture (RenderTexture object) ?
// example
var list = new TransformObjectList();
var xform = new Transform();
var _copy = true;
var _autoHistory = true;
// method responsible for dynamic draw preview?
TranformCommand.TransformObjects(list, xform, _copy, _autoHistory);
example command files below: