How to rotate scene via python script?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





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







up vote
1
down vote

favorite












I'm super new to Blender and working on a script for Blender. My question is how to rotate scene via python script, just like using middle mouse?



Thank you.










share|improve this question





















  • Would look at MMB more akin to orbiting our focus point in the scene. (see view matrix). Think of the scene as the basis of global coordinates.
    – batFINGER
    Aug 19 at 13:11
















up vote
1
down vote

favorite












I'm super new to Blender and working on a script for Blender. My question is how to rotate scene via python script, just like using middle mouse?



Thank you.










share|improve this question





















  • Would look at MMB more akin to orbiting our focus point in the scene. (see view matrix). Think of the scene as the basis of global coordinates.
    – batFINGER
    Aug 19 at 13:11












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'm super new to Blender and working on a script for Blender. My question is how to rotate scene via python script, just like using middle mouse?



Thank you.










share|improve this question













I'm super new to Blender and working on a script for Blender. My question is how to rotate scene via python script, just like using middle mouse?



Thank you.







python scene






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 19 at 12:50









DucViet321

363




363











  • Would look at MMB more akin to orbiting our focus point in the scene. (see view matrix). Think of the scene as the basis of global coordinates.
    – batFINGER
    Aug 19 at 13:11
















  • Would look at MMB more akin to orbiting our focus point in the scene. (see view matrix). Think of the scene as the basis of global coordinates.
    – batFINGER
    Aug 19 at 13:11















Would look at MMB more akin to orbiting our focus point in the scene. (see view matrix). Think of the scene as the basis of global coordinates.
– batFINGER
Aug 19 at 13:11




Would look at MMB more akin to orbiting our focus point in the scene. (see view matrix). Think of the scene as the basis of global coordinates.
– batFINGER
Aug 19 at 13:11










1 Answer
1






active

oldest

votes

















up vote
3
down vote













Thanks to batFINGER I've found the answer



import bpy
from mathutils import Euler

for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
area.spaces.active.region_3d.view_rotation.rotate(Euler((0, 0, 0.01)))





share|improve this answer




















    Your Answer




    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f116395%2fhow-to-rotate-scene-via-python-script%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    Thanks to batFINGER I've found the answer



    import bpy
    from mathutils import Euler

    for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
    area.spaces.active.region_3d.view_rotation.rotate(Euler((0, 0, 0.01)))





    share|improve this answer
























      up vote
      3
      down vote













      Thanks to batFINGER I've found the answer



      import bpy
      from mathutils import Euler

      for area in bpy.context.screen.areas:
      if area.type == 'VIEW_3D':
      area.spaces.active.region_3d.view_rotation.rotate(Euler((0, 0, 0.01)))





      share|improve this answer






















        up vote
        3
        down vote










        up vote
        3
        down vote









        Thanks to batFINGER I've found the answer



        import bpy
        from mathutils import Euler

        for area in bpy.context.screen.areas:
        if area.type == 'VIEW_3D':
        area.spaces.active.region_3d.view_rotation.rotate(Euler((0, 0, 0.01)))





        share|improve this answer












        Thanks to batFINGER I've found the answer



        import bpy
        from mathutils import Euler

        for area in bpy.context.screen.areas:
        if area.type == 'VIEW_3D':
        area.spaces.active.region_3d.view_rotation.rotate(Euler((0, 0, 0.01)))






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 19 at 15:57









        DucViet321

        363




        363



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f116395%2fhow-to-rotate-scene-via-python-script%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?