Background image size

The forums here are for Blender development. Questions and discussion about *using* Blender belong on blenderartists.org If your thread was moved here, you are probably in the wrong place.

Moderators: jesterKing, stiv

Post Reply
Reinforcer
Posts: 0
Joined: Fri Sep 20, 2013 9:37 am

Background image size

Post by Reinforcer » Mon Sep 30, 2013 12:24 pm

The problem here is the car in the image, the car left side, the front is facing the left so is the top. In this case you here to rotate the image 90 degree anti-clockwise, if not when you move the mesh horizontal in right/left view, it will be moving vertically in top view. So I did that, upload both image and find that the size is different. The image is 990 x 547 rotating it will be 547 x 990, but in Blender the 990 x 547 fit in the 547 x 990? http://www.1999.co.jp/itbig18/10183712t2.jpg

brasshat
Posts: 0
Joined: Mon Nov 16, 2009 1:06 pm

Post by brasshat » Tue Oct 01, 2013 2:37 am

I'm not entirely clear what you are asking. If it's how to use the image you have to create background images for use in Blender, I'd do this in GIMP, or a similar tool. What I would do is to create a base template of about 1000 x 600 or 1000 x 650 pixels, I'd copy the top, left, and right sides into this, and paste them into the base template, centering the image in the canvas. Then, in GIMP, I'd rotate the top to be perpendicular to the left and right sides.

As for the front and back views, I'd copy those into the center of the same base image. The reason for this is to avoid any need to adjust the image sizes in Blender.

Sorry if that doesn't answer your question.

s

Reinforcer
Posts: 0
Joined: Fri Sep 20, 2013 9:37 am

Post by Reinforcer » Wed Oct 02, 2013 12:54 pm

There are two image, size are 990 x 547 and 547 x 990, add background image for modeling, the 990 x 547 fit in the 547 x 990, why? Did I do something wrong?

brasshat
Posts: 0
Joined: Mon Nov 16, 2009 1:06 pm

Post by brasshat » Wed Oct 02, 2013 6:07 pm

I'm not sure that you did something wrong. I had trouble understanding what you did, and what you were asking, so I gave you a general narrative as to how I'd handle the image to which you posted the link.

ns

CoDEmanX
Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX » Wed Oct 02, 2013 8:57 pm

I wrote this script a while back to scale background imags to a pixel-per-unit ratio. Not sure if that helps.

Code: Select all

bl_info = {
    "name": "Background Image Rescale",
    "author": "CoDEmanX",
    "version": (1, 0),
    "blender": (2, 65, 0),
    "location": "View3D > Properties (N) > Background Images",
    "description": "Scale backgrounds to a pixel-per-unit factor for accurate reference images",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "3D View"}

import bpy

class VIEW3D_OT_background_image_rescale(bpy.types.Operator):
    """Scale background images of current view to a pixel-per-unit factor"""
    bl_idname = "view3d.background_image_rescale"
    bl_label = "Rescale"
    
    @classmethod
    def poll(cls, context):
        return (context.space_data.type == 'VIEW_3D' and
                context.space_data.background_images)

    def execute(self, context):
        factor = context.scene.background_image_scale_factor
        backgrounds = context.space_data.background_images
        
        for bg in backgrounds:
            bg_attr = 'image' if bg.source == 'IMAGE' else 'clip'
            bg_file = getattr(bg, bg_attr)
            
            if bg_file is not None:
                bg.size = bg_file.size[0] / factor / 2
                
        return {'FINISHED'}


def menu_func(self, context):
    layout = self.layout
    
    layout.label("Rescale all by factor:")
    
    row = layout.row(align=True)
    
    sub = row.column()
    sub.scale_x = 2
    sub.prop(context.scene, "background_image_scale_factor")
    
    row.operator("view3d.background_image_rescale")


def register():
    bpy.utils.register_module(__name__)
    bpy.types.Scene.background_image_scale_factor = bpy.props.IntProperty(
        name="Pixels / unit",
        description="Pixel-per-unit factor for scaling, larger numbers for smaller images",
        default=100,
        min=1,
        max=10000,
        soft_max = 1000
    )
    bpy.types.VIEW3D_PT_background_image.append(menu_func)


def unregister():
    bpy.utils.unregister_module(__name__)
    del bpy.types.Scene.background_image_scale_factor
    bpy.types.VIEW3D_PT_background_image.remove(menu_func)

if __name__ == "__main__":
    register()
I'm sitting, waiting, wishing, building Blender in superstition...

Reinforcer
Posts: 0
Joined: Fri Sep 20, 2013 9:37 am

Post by Reinforcer » Thu Oct 03, 2013 11:12 am

One horizontal rectangle plus one vertical rectangle, you get a cross. I add one horizontal image plus one vertical image, I get one straight line. Either one of the image I add had been scale up or down. Why?

CoDEmanX
Posts: 0
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Post by CoDEmanX » Thu Oct 03, 2013 5:07 pm

can you post a screen, or even better the problematic blend?

upload it here: http://www.pasteall.org/blend/
I'm sitting, waiting, wishing, building Blender in superstition...

brasshat
Posts: 0
Joined: Mon Nov 16, 2009 1:06 pm

Post by brasshat » Thu Oct 03, 2013 8:27 pm

CoDEmanX wrote:can you post a screen, or even better the problematic blend? ... <snippage>
or perhaps both a screen and a blend ...

ns

Post Reply