Is it possible to invoke DrawMe() of an inactive tool?
Moderators: Víctor Paredes, Belgarath, slowtiger
Is it possible to invoke DrawMe() of an inactive tool?
Hello, is it possible to call the DrawMe() function of an inactive tool in such a way that it can draw its graphics in the viewport?
Re: Is it possible to invoke DrawMe() of an inactive tool?
There are a number of tools that already do this like TransformPoints:
Code: Select all
function LM_TransformPoints:DrawMe(moho, view)
...
if (self.mode == self.selectMode and self.dragging) then
LM_SelectPoints:DrawMe(moho, view)
...
end
...
end
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Re: Is it possible to invoke DrawMe() of an inactive tool?
Sorry, I might have asked the question incorrectly. I meant that the tool itself could invoke its DrawMe() even when it's not active. So that its graphics could be visible when any other tool is active, without the need to modify all tools.
Re: Is it possible to invoke DrawMe() of an inactive tool?
This is how I've always achieved what I needed. But it would be nice to have it invoked on its own for sure...
- hayasidist
- Posts: 3526
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Is it possible to invoke DrawMe() of an inactive tool?
A thought --- DrawMe needs a MohoView. Is there any way that the "guts of the script" could provide the script's "IsEnabled" with a view that could be usable in its DrawMe() function???
I've had a go at this, and I can get IsEnabled to call DrawMe with a view object that I saved from the mainline run -- but right now I'm actually failing to get DrawMe to draw anything, even when in the tool's normal run-mode, so I've obviously screwed up somewhere in my DrawMe function... Sorry, but sorting that out is for another day - in the meantime, I'm logging this in the hope that it helps you guys make progress
I've had a go at this, and I can get IsEnabled to call DrawMe with a view object that I saved from the mainline run -- but right now I'm actually failing to get DrawMe to draw anything, even when in the tool's normal run-mode, so I've obviously screwed up somewhere in my DrawMe function... Sorry, but sorting that out is for another day - in the meantime, I'm logging this in the hope that it helps you guys make progress