Question about developing plugin to automate functions
-
Hi,
So essentially I'm trying to develop a plugin that will take live updating input and perform the task asked for by the useri'm interested in automating these functions:
-Move
-Rotate object
-draw (line, square, circle, etc.)
-stretch objectso as you notice these aren't camera functions, they're actually manipulating an object or creating some virtual image
it'll go something like this:
if cmd=move
select object
take input coordinates that refresh every .5 seconds and move according to the vector created by the inputs
etc.the only thing is.. i'm sort of stuck as to how i can actually get my logic running. can anyone give me some idea or method as to how i can start implementing this idea? I've considered using an animation scheme where you can change the rate at which the object moves and the delta coordinates (difference vector of where to move next), things like that. I've also thought about just using a tool to draw the line every .5 seconds or whatever the interval is to draw a line
do these sound like good ways to approach this task? if not, can someone enlighten me on a more efficient/robust way to accomplish this? Thanks so much!
-
https://developers.google.com/sketchup/docs/ourdoc/animation might be a good start...
-
@tig said:
https://developers.google.com/sketchup/docs/ourdoc/animation might be a good start...
yes thank you for that. i've looked through a majority of that but here's where the forum community comes into play. i'd like to hear what other people have to say and if anyone has done any similar projects so they can give some valid input as far as what method would be easiest and most practical in the long term
-
Try and find a copy of knightgame.rb and the Prince_IO, Spin_Yoda talks on the web C.2008/9.
john
-
It sounds more like you want to create a tool.
See the
UI::Tool
class in the API.Then read through and understand the "linetool.rb" script in the "Plugins/Examples" directory.
Keep in mind that scripting within a GUI application's process, is event-driven programming, not a linear sequential exercise.
You write a class with callback methods, that the application calls, in response to UI input, mouse movements, key presses, etc., from the user.
Advertisement