BluePrint add on to blender

Not bad! Great effort. Yet please try the measurement addons of Antonioya and cwolf3d. It may be a speed-up of the dimension visualization process.

you can add text and render to solid white and then do a black edge highlight, the idea should have been self explanitory, and i personally think a lot of you are fighting it because you think that blender is “fine” as it is… but anyone who settles for fine is wasting their time actualité geek

In the world development blueprint addon the text color is set as black if the background is white, white if the background is black. Using the foreground color.

The problem is the addon got stuck in the review queue of cgcookie. A video tutorial is missing … and all my monitors and my hard disk broke - and while fixed by now, my interest in the blueprint generation has ceased because a way more epic adventure rose to the horizon: making blender an EDA suite has had a design breakthrough …

And open source hardware projects of vast importance to the goals of world development take precedence.

You are right with fine,
yet there’s one issue and that is time.
Because better than fine requires even more time - and time is the most precious world “good” of mortals. So if I were Justus von Liebig I’d try to make time directly instead of via gold. Often the direct way is best.

@ faerietree,

How do you setup template (Frame) lightsaber+blueprints ?

1 Like

@sagado

Can You help maybe with script that creating blue print by scripts?
I’m thinking to “hang-on” the greace pencile object with text to camera object to have constant camera distance in case operations around camera for viewport perspective with “product”.

import bpy

bpy.ops.object.gpencil_add(align='WORLD', location=(0, 0, 0), scale=(1, 1, 1), type='EMPTY')

def get_grease_pencil(gpencil_obj_name='GPencil') -> bpy.types.GreasePencil:
    """
    Return the grease-pencil object with the given name. Initialize one if not already present.
    :param gpencil_obj_name: name/key of the grease pencil object in the scene
    """

    # If not present already, create grease pencil object
    if gpencil_obj_name not in bpy.context.scene.objects:
        bpy.ops.object.gpencil_add(view_align=False, location=(0, 0, 0), type='EMPTY')
        # rename grease pencil
        bpy.context.scene.objects[-1].name = gpencil_obj_name

    # Get grease pencil object
    gpencil = bpy.context.scene.objects[gpencil_obj_name]

    return gpencil


def get_grease_pencil_layer(gpencil: bpy.types.GreasePencil, gpencil_layer_name='GP_Layer',
                            clear_layer=False) -> bpy.types.GPencilLayer:
    """
    Return the grease-pencil layer with the given name. Create one if not already present.
    :param gpencil: grease-pencil object for the layer data
    :param gpencil_layer_name: name/key of the grease pencil layer
    :param clear_layer: whether to clear all previous layer data
    """

    # Get grease pencil layer or create one if none exists
    if gpencil.data.layers and gpencil_layer_name in gpencil.data.layers:
        gpencil_layer = gpencil.data.layers[gpencil_layer_name]
    else:
        gpencil_layer = gpencil.data.layers.new(gpencil_layer_name, set_active=True)

    if clear_layer:
        gpencil_layer.clear()  # clear all previous layer data

    # bpy.ops.gpencil.paintmode_toggle()  # need to trigger otherwise there is no frame

    return gpencil_layer


# Util for default behavior merging previous two methods
def init_grease_pencil(gpencil_obj_name='GPencil', gpencil_layer_name='GP_Layer',
                       clear_layer=True) -> bpy.types.GPencilLayer:
    gpencil = get_grease_pencil(gpencil_obj_name)
    gpencil_layer = get_grease_pencil_layer(gpencil, gpencil_layer_name, clear_layer=clear_layer)
    return gpencil_layer

def draw_line(gp_frame, p0: tuple, p1: tuple):
    # Init new stroke
    gp_stroke = gp_frame.strokes.new()
    gp_stroke.display_mode = '3DSPACE'  # allows for editing

    # Define stroke geometry
    gp_stroke.points.add(count=2)
    gp_stroke.points[0].co = p0
    gp_stroke.points[1].co = p1
    return gp_stroke

gp_layer = init_grease_pencil()
gp_frame = gp_layer.frames.new(0)

#gp_stroke.line_width = 10
#gp_stroke.material_index = 1

def draw_sq_():
    draw_line(gp_frame, (0, 0, 0), (0, 1, 0))
    draw_line(gp_frame, (0, 0, 0), (0.5, 0, 0))
    draw_line(gp_frame, (0.5, 0, 0), (0.5, 1, 0)) 
    draw_line(gp_frame, (0, 1, 0), (0.5, 1, 0)) 

def draw_sq(a, b):
    draw_line(gp_frame, (0, 0, 0), (0, a, 0))
    draw_line(gp_frame, (0, 0, 0), (b, 0, 0))
    draw_line(gp_frame, (b, 0, 0), (b, a, 0)) 
    draw_line(gp_frame, (0, a, 0), (b, a, 0)) 
    
a = 0.5
b = 1
draw_sq(a,b)
draw_sq(a,b*2)
draw_sq(a*2,b*2)
draw_sq(a*2,b)

project_title = bpy.data.curves.new(type="FONT", name="Project_Title")
project_title.body = "Project Title"
project_title = bpy.data.objects.new(name="Project_Title", object_data=project_title)
#project_title = bpy.data.objects.location=(1,0,0)
#font_obj.transform.resize(value=(1.5, 0.5, 0.5))
bpy.context.scene.collection.objects.link(project_title) 

#project_author = bpy.data.curves.new(type="FONT", name="Project_Author")
#project_author.body = "Project Author"
#project_author = bpy.data.objects.new(name="Project_Author", object_data=project_author)
#project_title = bpy.data.objects.location=(1,0,0)
#font_obj.transform.resize(value=(1.5, 0.5, 0.5))
#bpy.context.scene.collection.objects.link(project_author) 

Wow this is an old thread… If you are doing python scripting anyway there are probably better ways to draw a interface than the grease pencil. It is a good all in blender option but I feel like the more functional approach would be to use something like the matplotlib or using python to generate an html file with css setting the render as the background image with a div tag container scaled proportionally to the image and then using flask to make that into a pdf. Part of the problem blender was having and forgive me for not being able to fully wrap my brain around this in 2013. I was much younger and very excited… blender is not going to render vectors. What blender CAN do that is probably of more use to you, and what I do now for blueprint type work when I need to do thumbnailers and silhouettes, now working as a professional who choses to still use blender when I can is, I use blenders freestyle edges, and setting up a script to configure freestyle edges how you like is likely much easier in terms of getting a nice result.

Not trying to be not supportive, but I feel like trying to make this an all in viewport process is not the cleanest or most effective way of tackling this. I do hope to see it realized one way or another though

It’s experiment. By GP is often done GUI in UPBGE for games, so why not?
My vision by script was in way that the whole frame can be scaled and divided (A,B,C 1,2,3… etc) by needs, tables can be filled by addon, and the frame + txt can be tinted by colours (eg. white, black).
Due “pined” layer to front camera user can operate viewport with measure descriptions as want.

Regarding multiple divs… it’s more compliate as job for composition.

My argument is less against the legitimacy as a method that would work but more against whether the usecase, practicality, and need, really justify the means and method of doing it. Realistically, this is not information you need in your own viewport or render. This type of data is typically for outlining for others so unless a client or other individual is going to download blender and look through the viewport, I personally don’t see the use in doing it like this. You could have a panel where you put in all the information and create a script to draw your annotations (or hook into one of the existing ones) and then have your addon run intelligently placed freestyle edges and then export a document useful to others to look at.

If this is for you then I am not much help in this regard but if it is for other people I suggest following the industry standard techniques. It would save you time and effort and most individuals know how to open a PDF doc. Not everyone knows what to do in a viewport.