addon related to System console tells me "convertViewVec: called in an invalid contex

So my stepwise addon from more then 1 1/2 years ago starts to be usable again …

The addon is to be found here: voordbc.zip (45.3 KB)

Though comments … and info are for a part in Dutch, it should for English reading people nevertheless readable.
Extract the zip file to */2.70/scripts/addons (or where your addons live).
Activate as usual (search after activating the addon tab , Ctrl Alt U done, for stepwise and click!)

In the VIEW_3D there will be a tab DefineInfo where you may start with s_castle please!
In the PROPERTIES part of the Blender window activate now the Data and scroll down as far as possible
there you should find a button: Activeer
(Activat in Dutch)
And the repeat clicking “Nog een stap!” (meaning “and again a step”)
and a castle should appear step by step in the View3D ;-).
If you look now into the console of Blender (Window and Toggle Console!)
You, at least I, can see several “convertViewVec …” messages.

Why and how to get rid of these messages!!!

And by the way a second problem with the addon if you do not use the Data in Properties there will (at my Blender) occure an errormessage at step21, making roof colors of the first tower of the castle.
BUT one can go on and all works with wrong roofs.
WHY??? and what should I do ???

The warning is issued if the convertViewVec function is called internally and the space type not supported:

void convertViewVec(TransInfo *t, float r_vec[3], int dx, int dy)
{
    if ((t->spacetype == SPACE_VIEW3D) && (t->ar->regiontype == RGN_TYPE_WINDOW)) {
        const float mval_f[2] = {(float)dx, (float)dy};
        ED_view3d_win_to_delta(t->ar, mval_f, r_vec, t->zfac);
    }
    else if (t->spacetype == SPACE_IMAGE) {
        float aspx, aspy;

        if (t->options & CTX_MASK) {

            convertViewVec2D_mask(t->view, r_vec, dx, dy);
            ED_space_image_get_aspect(t->sa->spacedata.first, &aspx, &aspy);
        }
        else {
            convertViewVec2D(t->view, r_vec, dx, dy);
            ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
        }

        r_vec[0] *= aspx;
        r_vec[1] *= aspy;
    }
    else if (ELEM(t->spacetype, SPACE_IPO, SPACE_NLA)) {
        convertViewVec2D(t->view, r_vec, dx, dy);
    }
    else if (ELEM(t->spacetype, SPACE_NODE, SPACE_SEQ)) {
        convertViewVec2D(&t->ar->v2d, r_vec, dx, dy);
    }
    else if (t->spacetype == SPACE_CLIP) {
        float aspx, aspy;

        if (t->options & CTX_MASK) {
            convertViewVec2D_mask(t->view, r_vec, dx, dy);
        }
        else {
            convertViewVec2D(t->view, r_vec, dx, dy);
        }

        if (t->options & CTX_MOVIECLIP) {
            ED_space_clip_get_aspect_dimension_aware(t->sa->spacedata.first, &aspx, &aspy);
        }
        else if (t->options & CTX_MASK) {
            /* TODO - NOT WORKING, this isnt so bad since its only display aspect */
            ED_space_clip_get_aspect(t->sa->spacedata.first, &aspx, &aspy);
        }
        else {
            /* should never happen, quiet warnings */
            BLI_assert(0);
            aspx = aspy = 1.0f;
        }

        r_vec[0] *= aspx;
        r_vec[1] *= aspy;
    }
    else {
        printf("%s: called in an invalid context
", __func__);
        zero_v3(r_vec);
    }
}

So it only works:

3D: 3D View (Window region)

2D: UV/Image Editor, IPO, NLA, Node Editor, VSE, Movie Clip Editor

Otherwise it will be ignored.

Hallo CoDEmanX, sorry I do not understand this (yet) …

I have half of a circle (in x-y) plane selected and in editmode it is rotated 90 degrees (y-axis) and now it
is moved up 2 in z-direction by an exec(“…/step8()”) function from an imported script

def step8():
print(“rotate the half cirle into 3D: R y 90”)
#bpy.context.area.type = “VIEW_3D”
print("active object is ", bpy.context.active_object.name)
bpy.ops.transform.rotate(value=1.5708, axis=(0, 1, 0), constraint_axis=(False, True, False), constraint_orientation=‘GLOBAL’, mirror=False, proportional=‘DISABLED’, proportional_edit_falloff=‘SMOOTH’, proportional_size=1)

and it works but WITH message: convertViewVec: called in an invalid context
if the # to set VIEW_3D is removed, Blender Crashes at execution of the changed step8()

So your explanation , sorry I do not yet understand to see what I may have to do ;-(

Greets
Peter