Move drawing and background together

Next
 From:  mickelsen
4306.1 
I have a drawing in which I read in a background image and then traced it (long story short). Now I would like to move the stuff that I have drawn and have the background image move with it. In other words, I would like to be able to select the stuff that I have drawn and the background image together and then move everything together. Is this possible in any way?

Thanks,
Mark
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4306.2 In reply to 4306.1 
Hi Mark - you'll need to move them in 2 separate passes, one for the objects and one for the image, because the image is only moveable when you are inside of the Image command. It's set up that way because otherwise if image were just normally movable the same as objects it would be easy to end up moving the image around when you were actually trying to just click in the background area.

You may want to create a Point object (under Draw curve > More > Point) at the corner of your image before you move all objects, so that you can then move the image to snap on to that same point.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Colin
4306.3 In reply to 4306.1 
Hi Mark,

Whenever I'm using an image I always start out by drawing a Rectangle the approximate size I'll need with it's centre at 0,0,0
I then name this Rectangle "Image ref" & use it to align & position my Background Image in one go.
Because the Image ref is already named, I can then easily hide it & start drawing my model Curves.

So in your case now, maybe Hide all the existing model Curves & create a Rectangle to match your Background Image.
Once it's setup & named, Unhide the other Curves, use Select All & move to their new position.
Hide your model Curves again leaving the Image ref so you can reload the Background Image.

Remember to use the Image Properties & have the Image always associated with that 3DM file.

HTH, Colin
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mickelsen
4306.4 
Michael,

There seem to be a lot of times when I would find it useful to be able to "bind" parts of the drawing to the background image in order to accurately move or scale them together. You might think about this as something to put into v3.

Mark
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4306.5 In reply to 4306.4 
Hi Mark,

re:
> <...> "bind" parts of the drawing to the background image in order
> to accurately move or scale them together.

Any ideas on how the UI for that would look like?

One problem with such things is that having a way to make bindings like that would probably also imply having some way to see what is bound to what else, and also some way to remove such bindings. That could possibly mean some kind of fairly complex "binding manager" type mechanism...

I will try to think about it though.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mickelsen
4306.6 
Michael,
Right now we can "bind" things together just by having them all selected at the same time. You can then invoke the "move" command and everything will move together. If it were possible to select the background without being in the image command then you could move it along with everything else that was selected. At least, that's what it might look like to the user. Alternatively, if you could select external objects while you were in the image command, you could then move them the same way you move the background. Again, that's what it would look like from the user's point of view. Obviously, I have no idea what the internal structure and operations would be. (Although, having been a professional programmer for 20 years before I retired, I would very much like to understand it. I'd like to write my own macros and UI's. Where do people go to learn enough about your program to do things like that? I know, I know...totally different subject.)
Mark
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4306.7 In reply to 4306.6 
Hi Mark, yup that kind of more implicit binding through being selected rather than a more explicit persistent binding (which is what I thought you were asking about) could possibly be easier to set up.

However, right now though it's intentionally set up that you can't select background images while you are out of the Image command - that's because background images tend to span a large amount of the background and if they were selectable at the same time as regular geometry it would be quite easy to accidentally select them and move them unintentionally.

It's to prevent that kind of unintended manipulation that they stay non-selectable unless you are inside of the Image command.

Right this moment I'm not sure how to keep the current "prevent unintentional moving" type support and also at the same time allow image selection at regular model time like you're asking about. I guess it could potentially be a mode that could be set by a checkbox somewhere.


> I'd like to write my own macros and UI's. Where do people
> go to learn enough about your program to do things like that?

Well, it's not really a well documented or supported area right now, but the best starting point is here: http://moi3d.com/wiki/Scripting and since there aren't any step-by-step tutorials for that kidn of stuff you have to be kind of self sufficient and learn by studying existing commands and a lot of experimentation and trial and error.

It is an area that I want to support more in the future but it's a pretty time consuming area not just for producing documentation and tutorials for but also in trying to help others debug code and stuff like that. So it's probably not really an area that I'll be able to dig into fully until after more of the kind of core non-programming type areas of MoI are more fully finished.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mickelsen
4306.8 
In order to preserve the "prevent unintentional moving" support, perhaps this would be best performed only inside of the image command. How's this for a scenerio:

You select something in the drawing and then call the image command.
The image command tests to see if anything is selected when it starts up and, if so, asks the user (in some intelligible way) if he wants to maintain those selections in order to move them along with the background.
If the user says yes then MoI does whatever is necessary to bind the selected objects to the background, but only for the duration of that particular invocation of the image command.
The user does whatever he's going to do, and when he leaves the image command, the bind is revoked.

This would seem to me to restrict the ramifications of the binding as much as possible. What do you think?



As for learning to program things for MoI, a "diging in" starting point is what I'm looking for right now. One problem I'm going to have with this is that, although I have some training in higher level languages, my entire career involved real-time assembly language programming of microprocessors. What language is MoI written in?

Thanks,
Mark
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4306.9 In reply to 4306.8 
Hi Mark,

> The image command tests to see if anything is selected
> when it starts up and, if so, asks the user (in some
> intelligible way) if he wants to maintain those selections
> in order to move them along with the background.

I can forsee a lot of confusion with asking that question, because it's very frequent for people to go to the image command without any desire to move images around at all, like for example to just place a brand new image.

So that's going to be a confusing thing to pop up a message in an intelligible way when the question that they now have to answer doesn't have any relation to the task that they're trying to accomplish right then (like add a new image, adjust an opacity setting, hide an image, etc...) .

That's a big problem with popping up a modal question like that - it really has to definitely be relevant to what they are currently doing or else it will be both confusing and annoying to have to answer it as an additional step.


> As for learning to program things for MoI, a "diging in"
> starting point is what I'm looking for right now.

Well probably the first step is to explore the existing scripts - basically every command has a script file that controls how it operates and you can find all of them in the \commands sub-folder underneath MoI's main installation folder.

Similarly the main UI is defined by a bunch of HTML files in the \ui sub-folder inside of MoI's main installation folder.


> One problem I'm going to have with this is that,
> although I have some training in higher level languages,
> my entire career involved real-time assembly language
> programming of microprocessors. What language is MoI written in?

Hmmm, yeah so I guess really a first step would be to learn some JavaScript to start with - it's the language that is used for adding script logic to web pages so there are a lot of online resources that could get you started with some of the basics of JavaScript itself.

MoI is written in a combination of C++ and JavaScript - C++ is for the kind of core heavy lifting pieces and JavaScript is for controlling the overall command flow logic, like controlling the different stages of a command and calling services like point pickers to gather point inputs, and stuff like that.

The UI is done using HTML - if you look through the \commands sub-folder you'll find that each command has both a JavaScript .js file that holds the command logic and also a .htm file that contains the UI for the command.

You can make a new command by creating a new .htm and .js file that start with the command name and putting them in your \commands subfolder. You generally set up a keyboard shortcut to launch your new command. That's how the various plug-ins collected on Petr's site were created, see that scripting wiki link posted previously for a link to Petr's site.


It's going to be a pretty difficult area to dig into currently though, since I'm not ready yet to spend very much time supporting this area.


- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mickelsen
4306.10 
Hi Michael,
I understand what you're saying about the confusion factor. You've obviously done a LOT of thinking about UI issues. That's why I said that the question would be asked only if there were things selected when entering the command. However, that may not be enough to keep things clear.

I understand that you're not particularly interested in tutoring people in programming add-ons to your software. I have had some basic classes in Javascript and C++ (the dreaded C++). I very much appreciate the information that you have already given me. I'm sure it is a difficult task, but others have done it. This will be a background project for me after several other projects that I have going on.

Thanks,
Mark
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4306.11 In reply to 4306.10 
Hi Mark,

> That's why I said that the question would be asked only
> if there were things selected when entering the command.
> However, that may not be enough to keep things clear.

Yeah the problem is that many people may not expect for the object selection to have any significant relevance when going to the Image command. So because of that they may happen to have some objects selected and then have that message pop up.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
4306.12 In reply to 4306.10 
Hi Mark,

> I understand that you're not particularly interested in
> tutoring people in programming add-ons to your software.

Well, I think I will get there eventually - but I think I need to have somewhat more of the regular non-programming features more refined first before being able to do that though.

Another aspect that is difficult about concentrating on people making add-ons is that it tends to be difficult to make changes to the program structure when there are a whole lot of various external things that are depending on how things work currently. I want to refine things and add a bit more regular functionality first before I'll be really confident about locking things into place for a longer period which tends to happen with a focus on add-ons.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All