Set orthographic view using python?poll() failed, context incorrect? - Example: bpy.ops.view3d.background_image_add()Can “Toggle Quad view” remember the viewpoint?Zoom in to all objects in view using PythonHow come I can't see my bones in orthographic view?Set vertex normal in a stable manner with pythonMatch Orthographic along normals?2D zoom in 3D viewBlender 2.8 (Python) - knife projectChanging views in 2.8 jumps out of ortho

Set orthographic view using python?

Docker compose volume syntax valid for Windows and Linux

Talk interpreter

Hangman game in Python - need feedback on the quality of code

Router on a stick not connecting 2 different VLANs

Is the internet in Madagascar faster than in UK?

Weird corners with cline

Shift lens vs move body?

50-move rule: only the last 50 or any consecutive 50?

Discussing work with supervisor in an invited dinner with his family

Why is adding AC power easier than adding DC power?

How to prevent a hosting company from accessing a VM's encryption keys?

Why is "dyadic" the only word with the prefix "dy-"?

Why is strlen so complex in C?

74S vs 74LS ICs

What are the occurences of total war in the Native Americans?

Did Israelites who stayed in Egypt become halachically Jewish?

rationalizing sieges in a modern/near-future setting

How is linear momentum conserved in case of a freely falling body?

Is this password scheme legit?

Why does a sticker slowly peel off, but if it is pulled quickly it tears?

What is this fighter jet at Weymouth NAS?

When using a variable to set the path, I get "No such file or directory", but works fine otherwise

Retroactively modifying humans for Earth?



Set orthographic view using python?


poll() failed, context incorrect? - Example: bpy.ops.view3d.background_image_add()Can “Toggle Quad view” remember the viewpoint?Zoom in to all objects in view using PythonHow come I can't see my bones in orthographic view?Set vertex normal in a stable manner with pythonMatch Orthographic along normals?2D zoom in 3D viewBlender 2.8 (Python) - knife projectChanging views in 2.8 jumps out of ortho






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4












$begingroup$


Is there a python function that sets ortho view such that X and Y axes are visible - the equivalent of numpad 7?



Thanks in advance!










share|improve this question











$endgroup$













  • $begingroup$
    Enable python tooltips in the preferences, then go to View > Viewpoint > Top and wait a second.
    $endgroup$
    – brockmann
    10 hours ago










  • $begingroup$
    Thanks; when I tried the code it threw this error: RuntimeError: Operator bpy.ops.view3d.view_axis.poll() failed, context is incorrect
    $endgroup$
    – vndep
    10 hours ago










  • $begingroup$
    Common question: blender.stackexchange.com/questions/6101/…
    $endgroup$
    – brockmann
    10 hours ago










  • $begingroup$
    Why wouldn't this work: for area in bpy.context.screen.areas: if area.type=='VIEW_3D': bpy.ops.view3d.view_axis(type='TOP')
    $endgroup$
    – vndep
    9 hours ago

















4












$begingroup$


Is there a python function that sets ortho view such that X and Y axes are visible - the equivalent of numpad 7?



Thanks in advance!










share|improve this question











$endgroup$













  • $begingroup$
    Enable python tooltips in the preferences, then go to View > Viewpoint > Top and wait a second.
    $endgroup$
    – brockmann
    10 hours ago










  • $begingroup$
    Thanks; when I tried the code it threw this error: RuntimeError: Operator bpy.ops.view3d.view_axis.poll() failed, context is incorrect
    $endgroup$
    – vndep
    10 hours ago










  • $begingroup$
    Common question: blender.stackexchange.com/questions/6101/…
    $endgroup$
    – brockmann
    10 hours ago










  • $begingroup$
    Why wouldn't this work: for area in bpy.context.screen.areas: if area.type=='VIEW_3D': bpy.ops.view3d.view_axis(type='TOP')
    $endgroup$
    – vndep
    9 hours ago













4












4








4





$begingroup$


Is there a python function that sets ortho view such that X and Y axes are visible - the equivalent of numpad 7?



Thanks in advance!










share|improve this question











$endgroup$




Is there a python function that sets ortho view such that X and Y axes are visible - the equivalent of numpad 7?



Thanks in advance!







python 3d-view orthographic






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 9 hours ago









brockmann

1,6646 silver badges31 bronze badges




1,6646 silver badges31 bronze badges










asked 10 hours ago









vndepvndep

1158 bronze badges




1158 bronze badges














  • $begingroup$
    Enable python tooltips in the preferences, then go to View > Viewpoint > Top and wait a second.
    $endgroup$
    – brockmann
    10 hours ago










  • $begingroup$
    Thanks; when I tried the code it threw this error: RuntimeError: Operator bpy.ops.view3d.view_axis.poll() failed, context is incorrect
    $endgroup$
    – vndep
    10 hours ago










  • $begingroup$
    Common question: blender.stackexchange.com/questions/6101/…
    $endgroup$
    – brockmann
    10 hours ago










  • $begingroup$
    Why wouldn't this work: for area in bpy.context.screen.areas: if area.type=='VIEW_3D': bpy.ops.view3d.view_axis(type='TOP')
    $endgroup$
    – vndep
    9 hours ago
















  • $begingroup$
    Enable python tooltips in the preferences, then go to View > Viewpoint > Top and wait a second.
    $endgroup$
    – brockmann
    10 hours ago










  • $begingroup$
    Thanks; when I tried the code it threw this error: RuntimeError: Operator bpy.ops.view3d.view_axis.poll() failed, context is incorrect
    $endgroup$
    – vndep
    10 hours ago










  • $begingroup$
    Common question: blender.stackexchange.com/questions/6101/…
    $endgroup$
    – brockmann
    10 hours ago










  • $begingroup$
    Why wouldn't this work: for area in bpy.context.screen.areas: if area.type=='VIEW_3D': bpy.ops.view3d.view_axis(type='TOP')
    $endgroup$
    – vndep
    9 hours ago















$begingroup$
Enable python tooltips in the preferences, then go to View > Viewpoint > Top and wait a second.
$endgroup$
– brockmann
10 hours ago




$begingroup$
Enable python tooltips in the preferences, then go to View > Viewpoint > Top and wait a second.
$endgroup$
– brockmann
10 hours ago












$begingroup$
Thanks; when I tried the code it threw this error: RuntimeError: Operator bpy.ops.view3d.view_axis.poll() failed, context is incorrect
$endgroup$
– vndep
10 hours ago




$begingroup$
Thanks; when I tried the code it threw this error: RuntimeError: Operator bpy.ops.view3d.view_axis.poll() failed, context is incorrect
$endgroup$
– vndep
10 hours ago












$begingroup$
Common question: blender.stackexchange.com/questions/6101/…
$endgroup$
– brockmann
10 hours ago




$begingroup$
Common question: blender.stackexchange.com/questions/6101/…
$endgroup$
– brockmann
10 hours ago












$begingroup$
Why wouldn't this work: for area in bpy.context.screen.areas: if area.type=='VIEW_3D': bpy.ops.view3d.view_axis(type='TOP')
$endgroup$
– vndep
9 hours ago




$begingroup$
Why wouldn't this work: for area in bpy.context.screen.areas: if area.type=='VIEW_3D': bpy.ops.view3d.view_axis(type='TOP')
$endgroup$
– vndep
9 hours ago










1 Answer
1






active

oldest

votes


















5













$begingroup$

You can override the context when calling view_axis() operator:



import bpy
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
override = bpy.context.copy()
override['area'] = area
bpy.ops.view3d.view_axis(override, type='TOP')
break





share|improve this answer









$endgroup$

















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "502"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f149835%2fset-orthographic-view-using-python%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5













    $begingroup$

    You can override the context when calling view_axis() operator:



    import bpy
    for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
    override = bpy.context.copy()
    override['area'] = area
    bpy.ops.view3d.view_axis(override, type='TOP')
    break





    share|improve this answer









    $endgroup$



















      5













      $begingroup$

      You can override the context when calling view_axis() operator:



      import bpy
      for area in bpy.context.screen.areas:
      if area.type == 'VIEW_3D':
      override = bpy.context.copy()
      override['area'] = area
      bpy.ops.view3d.view_axis(override, type='TOP')
      break





      share|improve this answer









      $endgroup$

















        5














        5










        5







        $begingroup$

        You can override the context when calling view_axis() operator:



        import bpy
        for area in bpy.context.screen.areas:
        if area.type == 'VIEW_3D':
        override = bpy.context.copy()
        override['area'] = area
        bpy.ops.view3d.view_axis(override, type='TOP')
        break





        share|improve this answer









        $endgroup$



        You can override the context when calling view_axis() operator:



        import bpy
        for area in bpy.context.screen.areas:
        if area.type == 'VIEW_3D':
        override = bpy.context.copy()
        override['area'] = area
        bpy.ops.view3d.view_axis(override, type='TOP')
        break






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 9 hours ago









        brockmannbrockmann

        1,6646 silver badges31 bronze badges




        1,6646 silver badges31 bronze badges






























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Blender Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f149835%2fset-orthographic-view-using-python%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Sahara Skak | Bilen | Luke uk diar | NawigatsjuunCommonskategorii: SaharaWikivoyage raisfeerer: Sahara26° N, 13° O

            The fall designs the understood secretary. Looking glass Science Shock Discovery Hot Everybody Loves Raymond Smile 곳 서비스 성실하다 Defas Kaloolon Definition: To combine or impregnate with sulphur or any of its compounds as to sulphurize caoutchouc in vulcanizing Flame colored Reason Useful Thin Help 갖다 유명하다 낙엽 장례식 Country Iron Definition: A fencer a gladiator one who exhibits his skill in the use of the sword Definition: The American black throated bunting Spiza Americana Nostalgic Needy Method to my madness 시키다 평가되다 전부 소설가 우아하다 Argument Tin Feeling Representative Gym Music Gaur Chicken 일쑤 코치 편 학생증 The harbor values the sugar. Vasagle Yammoe Enstatite Definition: Capable of being limited Road Neighborly Five Refer Built Kangaroo 비비다 Degree Release Bargain Horse 하루 형님 유교 석 동부 괴롭히다 경제력

            19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу