Interesting Issue With Origin

Hi Guys

I got a model today with plenty of layers and scenes in it. As I was going through this model I noticed some heavy clipping going on. This I imagine this was because the model origin was far from the sketchup origin. I moved them together and it seemed better. BUT… now all the scenes are screwed about 15 of them. I thought I might be able to move the sketchup origin but this doesn’t seem possible. I’m not sure even if I could that it would work. Any ideas besides moving the model and recreating all the scenes.

Thanks in advance.

I’ve seen this in the past with models that I’ve been sent and it is a pain to fix. Although I haven’t tried it, I wonder if you could mark the camera locations for the various scenes and move them with the model to the origin. Then use those camera positions to set up the views. Update only the Camera Location for the scenes as you go. I’m thinking TIG or Eneroth3 might have an extension that would put guidepoints or something at the camera locations. I’ll hunt.

1 Like

I also don’t know if there is a existing extension that does so, but it would be pretty easy to create one that would move model contents and scene cameras by the same amount so that scene appearance would be unchanged. It would get more complex if any rotation (orbit) was needed, but still seems feasible.

2 Likes

That would be cool to have a one step process.

1 Like

Here’s an outline of the concept:

  1. User picks a point in the model that should be moved to the origin.
  2. Extension calculates the vector from that point to the origin
  3. Extension creates a transformation for that vector and applies it to each Entity in the model
  4. Extension adjusts the camera eye position and target for each scene in the model by offsetting with the same vector
1 Like

Thanks Dave.

This is interesting. If you were able to set cameras relative to the model in the scenes so they would move with the model as opposed to being set to an absolute “Sketchup space.” I’m pretty new to this but it does sound as it maybe useful.

There isn’t a native way to connect the cameras to the model but I seem to recall an extension that marks where the cameras are with guidepoints. My thought is you’d move the guidepoints with the rest of the model and then go through the scenes placing the camera at the guidepoints again. I like Steve’s idea of a single step process, though.

Guide Tools has an option for putting a guidepoint at the "camera eye. This would get you there. Look for it in the Extension Warehouse.

1 Like

I posted code to move page cameras to origin with the model…

couple of weeks ago…

john

1 Like

You sound pretty clued up on this. That’s getting a bit above my skills.

Thanks for the info. Now I need to go and try and figure out everything you said. LOL

Why didn’t I see that?

Don’t answer that.

2 Likes

How or where one find such code? Asking for a friend.

I was also involved with that convo. But it was about moving the model so it was centered on the world origin. Close. The code could be adjusted.

1 Like

Yep, aside from centering or arbitrarily moving the model vs interactive selecting of what to put at the origin, that code does what I outlined. I too forgot about that topic and also that camera movements are not captured on the undo stack.

1 Like

Thanks Dan

While I read through this thread it did sound a lot like what I’d like to do. As far as I can tell. Unfortunately I’m not to keyed up on coding. Would I just copy that code and paste to the ruby console? Sorry in advance for my newbness.

Take the final code in that topic and cut-paste it into the Ruby Console window in SketchUp. That should do the trick!

1 Like

Will give it a try.
Thanks guys your all stars.

Oh it needs to be tweaked a bit to move the lower left corner to the origin instead of the bottom center of the model entities to the origin.

Then the menu command would be manually executed.

1 Like

Basically the code changed so the name of the module, method and menu command reflects “Move to Origin” instead of centering.

Then the vector needed is adjusted …

center = model.bounds.center
vec =  Geom::Point3d.new(center.x,center.y,0).vector_to(ORIGIN)

… needs to change to …

vec =  Geom::Point3d.new(model.bounds.corner(0)).vector_to(ORIGIN)