This adds the functionality for displaying images on a empty object. This is particularly useful when several reference images are needed as with modeling with cross sections or when the image needs to be on a plane other than the predefined views (Top, Right, Front).
Description
Event Timeline
Looks good to me but I haven't tested it. Since this was discussed and suggested by cambo, I'll assign it to him.
68: OB_EMPTY_IMAGE - Id not bother with this, if the image pointer is
set, its a reference image empty.
102: Needs to check the ID is an image datablock, search for GS(id->name)
143: did this change anything? - try to avoid this, I use 'meld' and a
script mmeld, http://wiki.blender.org/index.php/User:Ideasman42#mmeld
to diff what I changed from SVN.
197: orig is for parent child relationships, though I realize this is
nice in some ways, for now it shouldnt be used for this purpose.
Parenting would reset your image for eg.
228: "empty_image", no need for this IMHO, should be able to use
ob.data, if you have trouble with this I can try fix when I review.
242: your patch is using tabs rather then spaces, C-Tabs, Py-Spaces,
(know its annoying :S)
321: dont think this is needed
327: you need to make sure ibuf->rect is not NULL still.
329: the image resolution should not effect its draw size I think,
only its aspect. unit should also be ignored here at least.
best draw it 1x1, were x or y may be <1 because of the aspect. Then
the scale and empty draw size can scale that.
337, 363: glColor4fv works with one arg.
445: don't think operators are needed to assign and remove images, but
for now not suggesting they be removed if you need them to test the
patch.
Messed around with this a bit...
http://www.pasteall.org/13594/diff
The only problem I can find is the 'unlink datablock' button in the UI code doesn't work.
Tried it without the scale code as Campbell suggested but it makes *huge* images that way even on a 512x512 test image.
Got this puppy working with custom bone shapes.
http://www.pasteall.org/13653/diff
The Bone.draw_wire checkbox turns off the outline. Also the armature draw code only does single-sided so the image only shows on one side.
Eh, whoops, left some extra code in draw_custom_bone()
http://www.pasteall.org/13654/diff
Ok, hopefully the last patch...
http://www.pasteall.org/13675/diff
Got all the bone colors working as they should and fixed a bug that broke custom mesh shapes.
The armature ghost function needs some work to play nicely with the rest of the armature colors but I'm sure that's known since there's a 'fix' that breaks object mode outline drawing.
Attached an updated version of the patch: r32704.
- based on Dan Eicher's patch
- dont use scene scale
- scale is now 1.0 no the largest axis, ignore image pixel size.
- removed pose bone color support for now, Id rather add this in once the patch is accepted, it makes it a bit messy.
attached a different patch, not based on the previous.
This is very simple, rather then having the empty display the image, I added an option for the BG image to be positioned on an object.
This means the image info is still window data, but at least it helps to position images in the 3D view.