Page 3 of 13 FirstFirst 12345 ... LastLast
Results 41 to 60 of 251
  1. #41
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    Originally Posted by pep View Post
    Ouch !
    it worked on my suse 11.2 64bit machine and stopped working with 2.55
    this is the error message output

    File "Screencast.py", line 91, in <module>
    register()
    File "Screencast.py", line 83, in register
    bpy.types.register(ScreencastKeysStatus)
    AttributeError: bpy.types.register(...): already registered as a subclass.

    hope you can fix it, i really like it.
    Read the error message!!!
    set a # in front of the offending line!

    Edit: oh you have already a good version , sorry.
    Last edited by PKHG; 07-Nov-10 at 11:19. Reason: sorry



  2. #42
    Member Bao2's Avatar
    Join Date
    Aug 2009
    Location
    Galicia - Spain
    Posts
    4,832
    For Blender 2.55:

    space_view3d_screencast_keys.py

    Code:
    # Original Script by: Paulo Gomes 
    # Contact: [email protected] 
    #  
    # Contributor(s): Bart Crouch 
    # 
    # Tested with r33563 
    # 
    # ##### BEGIN GPL LICENSE BLOCK ##### 
    # 
    #  This program is free software; you can redistribute it and/or 
    #  modify it under the terms of the GNU General Public License 
    #  as published by the Free Software Foundation; either version 2 
    #  of the License, or (at your option) any later version. 
    # 
    #  This program is distributed in the hope that it will be useful, 
    #  but WITHOUT ANY WARRANTY; without even the implied warranty of 
    #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    #  GNU General Public License for more details. 
    # 
    #  You should have received a copy of the GNU General Public License 
    #  along with this program; if not, write to the Free Software Foundation, 
    #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 
    # 
    # ##### END GPL LICENSE BLOCK ##### 
     
     
    import bpy 
    import bgl 
    import blf 
    import time 
     
     
    # information for the add-ons window 
    bl_addon_info = { 
        'name': '3D View:Screencast Key Status Tool', 
        'author': 'Paulo Gomes', 
        'version': (0,4), 
        'blender': (2, 5, 5), 
        'location': 'View3D > Spacebar > Search for "Screencast Key Status Tool"', 
        'description': 'Display keys pressed in the 3d-view, useful for screencasts.', 
        'warning': '', 
        'wiki_url': '', 
        'tracker_url': '', 
        'category': '3D View'} 
     
     
     
    def draw_callback_px(self, context): 
        # draw text in the 3d-view 
        blf.size(0, 20, 72) 
        final = 0 
     
        # only display key-presses of last 2 seconds 
        for i in range(len(self.key)): 
            if time.time()-self.time[i] < 2: 
                blf.position(0, 15, 70+20*i, 0) 
                blf.draw(0, self.key[i]) 
                final = i 
            else: 
                break 
     
        # get rid of statuses that aren't displayed anymore 
        self.key = self.key[:final+1] 
        self.time = self.time[:final+1] 
         
     
    class ScreencastKeysStatus(bpy.types.Operator): 
        '''Draw keys pressed in 3DView''' 
        bl_idname = 'view3d.screencast_keys' 
        bl_label = 'Screencast Key Status Tool' 
     
        def modal(self, context, event): 
            context.area.tag_redraw() 
     
            # keys that shouldn't show up in the 3d-view 
            ignore_keys = ['LEFT_SHIFT', 'RIGHT_SHIFT', 'LEFT_ALT', 'RIGHT_ALT',  
            'LEFT_CTRL', 'RIGHT_CTRL','TIMER', 'MOUSEMOVE', 'MIDDLEMOUSE', 
            'LEFTMOUSE', 'RIGHTMOUSE', 'WHEELDOWNMOUSE', 'WHEELUPMOUSE',  
            'NONE'] 
     
            if event.value == 'PRESS': 
                # add key-press to display-list 
                sc_keys = [] 
                 
                if event.shift: 
                    sc_keys.append('Shift ') 
             
                if event.alt: 
                    sc_keys.append('Alt ') 
             
                if event.ctrl: 
                    sc_keys.append('Ctrl ') 
     
                if event.type not in ignore_keys: 
                    sc_keys.append(event.type) 
                 
                    self.key.insert(0, '+ '.join(map(str, sc_keys))) 
                    self.time.insert(0, time.time()) 
     
            if event.type == ('F7'): 
                # stop script 
                context.region.callback_remove(self._handle) 
                return {'CANCELLED'} 
     
            return {'PASS_THROUGH'} 
     
        def invoke(self, context, event): 
            if context.area.type == 'VIEW_3D': 
                # start script 
                context.window_manager.modal_handler_add(self) 
     
                self._handle = context.region.callback_add(draw_callback_px, (self, context), 'POST_PIXEL') 
                self.key = [] 
                self.time = [] 
           
                return {'RUNNING_MODAL'} 
     
            else: 
                # operator not invoked from within the 3d-view 
                self.report({'WARNING'}, 'View3D not found, cannot run operator') 
                return {'CANCELLED'} 
     
    def register(): 
        pass 
     
    def unregister(): 
        pass 
     
    if __name__ == '__main__': 
        register()
    >>> Neytiri WIP <<<
    When explanations are complex you know there is no Truth on it.
    Tangled Fan Art



  3. #43
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    Does not work in the latest Blender of yesterday (W32 Vista)
    See:
    >>> dir(bpy.context.window_manager)
    ['__doc__', '__module__', '__slots__', 'add_fileselect', 'add_modal_handler', 'animation_data_clear', 'animation_data_create', 'bl_rna', 'clipboard', 'copy', 'invoke_confirm', 'invoke_popup', 'invoke_props_dialog', 'invoke_props_popup', 'invoke_search_popup', 'keyconfigs', 'library', 'name', 'operators', 'rna_type', 'tag', 'use_fake_user', 'user_clear', 'users', 'windows']

    >>>

    and the message:
    Traceback (most recent call last):
    File "Text", line 110, in invoke
    AttributeError: 'WindowManager' object has no attribute 'modal_handler_add'

    EDIT: I see
    it is add_modal_handler ;-)



  4. #44
    Member Bao2's Avatar
    Join Date
    Aug 2009
    Location
    Galicia - Spain
    Posts
    4,832
    Yes, post 42 has the new code for 2.55.
    I see they are continually renaming functions that way, it is because it is more easy to remember to have all in the same way and blender code is huuuuge.

    I am trying understand things and you can spend hours and hours and do not find yet how the hell things are done. For example only recently I could understand the menus are not in the C code but are external python scripts (probably to people be able to modify them to their pleasure).
    I understand now also why in the menus there is select border, and select circle but there is not select lasso. It doesn't works because it starts to select lasso from the menu. This brings a situation I don't like: there are options that are only accessible on shortcuts but not in menus. I don't like that in any app.
    Last edited by Bao2; 09-Dec-10 at 04:07.
    >>> Neytiri WIP <<<
    When explanations are complex you know there is no Truth on it.
    Tangled Fan Art



  5. #45
    Member realtronix's Avatar
    Join Date
    Jun 2009
    Location
    Munich Germany
    Posts
    66
    hy - cool script - i followed the instructions carefully - but get that ERROR with official 2.55 when i click on "Screencast key Status Tool"

    AttributeError: 'WindowManager' object has no attribute 'modal_handler_add'
    Traceback (most recent call last):
    File "Text", line 110, in invoke
    AttributeError: 'WindowManager' object has no attribute 'modal_handler_add'
    Free german tutorials on www.BlenderHilfe.de
    My german training-DVDs on www.Shop.Blenderhilfe.de



  6. #46
    Member Bao2's Avatar
    Join Date
    Aug 2009
    Location
    Galicia - Spain
    Posts
    4,832
    I have checked and it is working. Are you using the script in post 42?
    >>> Neytiri WIP <<<
    When explanations are complex you know there is no Truth on it.
    Tangled Fan Art



  7. #47
    Member realtronix's Avatar
    Join Date
    Jun 2009
    Location
    Munich Germany
    Posts
    66
    yeah from #42 (i double checked it)

    - i have named i "space_view3d_screencast_keys.py"
    - copyed the file to addons dir
    - enabled it
    - space > search > klick on it

    got the same error

    Do i have to install a special python version ? (i got this bundled py message at startup)
    i just have python for the "old" blender installed...
    maybe this is wrong ??

    thx for helping

    greetings
    tobi
    Last edited by realtronix; 15-Dec-10 at 09:53.
    Free german tutorials on www.BlenderHilfe.de
    My german training-DVDs on www.Shop.Blenderhilfe.de



  8. #48
    Member Bao2's Avatar
    Join Date
    Aug 2009
    Location
    Galicia - Spain
    Posts
    4,832
    It is not a plugin to add to any folder.

    Open a text window. Add a new text and copy paste the script text. Run the script clicking on the Run script button below.

    Now as it is said in the script:
    View3D > Spacebar > Search for "Screencast Key Status Tool"

    and start to press keyboard and it will show

    Read the way it is used in the "location" line in the code (line 39 I think)

    Tell me the version of blender you are using and the exactly steps you do if it doesn't work.
    Last edited by Bao2; 15-Dec-10 at 11:03.
    >>> Neytiri WIP <<<
    When explanations are complex you know there is no Truth on it.
    Tangled Fan Art



  9. #49
    Member Bao2's Avatar
    Join Date
    Aug 2009
    Location
    Galicia - Spain
    Posts
    4,832
    (Answering a private message about it don't working: )
    I will upload a video. Give me some time.
    >>> Neytiri WIP <<<
    When explanations are complex you know there is no Truth on it.
    Tangled Fan Art



  10. #50
    Member realtronix's Avatar
    Join Date
    Jun 2009
    Location
    Munich Germany
    Posts
    66
    Yes, the thread is the right place, youre right
    im pretty sure that ive done everthing right with the script, but a video-demo can make it clear.
    thx, tobi
    Free german tutorials on www.BlenderHilfe.de
    My german training-DVDs on www.Shop.Blenderhilfe.de



  11. #51
    Member Bao2's Avatar
    Join Date
    Aug 2009
    Location
    Galicia - Spain
    Posts
    4,832
    In the video I am using Blender 2.55 build 33684
    >>> Neytiri WIP <<<
    When explanations are complex you know there is no Truth on it.
    Tangled Fan Art



  12. #52
    Member Bao2's Avatar
    Join Date
    Aug 2009
    Location
    Galicia - Spain
    Posts
    4,832
    Download the video at 720 HD and use VLC in half speed (0.5x) to see it at real time.
    At the end of the video the script is not able to show the keys I use to lasso select vertices so it is not perfect. But a great work of Paulo Gomes as it is at the moment!!!
    Last edited by Bao2; 15-Dec-10 at 17:16.
    >>> Neytiri WIP <<<
    When explanations are complex you know there is no Truth on it.
    Tangled Fan Art



  13. #53
    Member realtronix's Avatar
    Join Date
    Jun 2009
    Location
    Munich Germany
    Posts
    66
    ok, but im using 2.55 OFFICIAL (build r32738) like i said before.... so okay - thats the point !

    is this an official release - i ask this because i dont want to work with a release that maybe has features that are not official (to avoid confusion)
    if it is official - where can i get it - and how i know it is an offical release - not a testing one ?

    and how can i tell this to blender-newbies in my tutorials - it seems very confusing with all this (test)releases?
    is there a save (not testing) line of build i can easyly follow without worry to run in an unofficial directon?
    just wanna keep it straight as a user and trainer.

    if one can answer this question maybe im a step closer to the truth of the new blender and development in generall

    thank you for helping and sharing ;-)
    good night
    tobi
    Free german tutorials on www.BlenderHilfe.de
    My german training-DVDs on www.Shop.Blenderhilfe.de



  14. #54
    Member Bao2's Avatar
    Join Date
    Aug 2009
    Location
    Galicia - Spain
    Posts
    4,832
    Except Bmesh builds all the rest is just the "official" build with added things that will not make your blend files incompatible with future official releases. Bmesh uses a different way of meshes so any build that don't have bmesh code would be unable to read it.

    There are a lot of bug fixes from the release you are using so I really recommend you download one from graphicall. Just don't use the addons they usually have installed and you are sticking to "official".
    >>> Neytiri WIP <<<
    When explanations are complex you know there is no Truth on it.
    Tangled Fan Art



  15. #55
    hi all, i've changed the script a little, i've added a menu in the properties panel display tab.

    Link to wiki


    Link to script


    activate the script:
    - Put the script in \\.blender\scripts\addons.
    - In user preferences you can see the Add-Ons menu.
    - You can activate the script here.
    - The script will now show up in the properties panel of the 3d view in the Display tab.

    what buttons do:
    - 'Screencast Keys Status' activates/deactivates script.
    - 'Pos x' 'Pos y' Position of the text.
    - 'Size' Size of the font.
    - 'Mouse' Activates/Deactivates display of mouse events.


    Thanks Bao2 for the updates in the script.



  16. #56
    Member tungee's Avatar
    Join Date
    Nov 2007
    Location
    Germany Frankfurt
    Posts
    1,522
    Thanx Paulo!
    I tested it recently and i must say that this tool must be in the trunk! definetely!
    Last edited by tungee; 16-Dec-10 at 12:51.



  17. #57
    Member cekuhnen's Avatar
    Join Date
    Mar 2003
    Location
    Grosse Pointe Woods, Michigan, USA
    Posts
    11,983
    bohr as we Germans would say in my local slang

    a cool example to show the benefit of the new python driven interface
    3D Design Generalist - Faculty Industrial + Interior Design
    Chair Interior Design - Wayne State University



  18. #58
    Member Bao2's Avatar
    Join Date
    Aug 2009
    Location
    Galicia - Spain
    Posts
    4,832
    Thanks Paulo it is much better now in 3DView properties panel. I just don't understand why this feature of showing the keys that are pressed is not in the C code of blender and continues to be a external script. And it is the most important script in the addons folder in my opinion.

    I use it with these changes:
    in ignore_keys list I added 'NONE'
    Size default to 40
    Pos Y default to 70
    'name': 'Screencast Key Status Tool' (deleting "3DView:" )
    Last edited by Bao2; 16-Dec-10 at 15:57.
    >>> Neytiri WIP <<<
    When explanations are complex you know there is no Truth on it.
    Tangled Fan Art



  19. #59
    Member tungee's Avatar
    Join Date
    Nov 2007
    Location
    Germany Frankfurt
    Posts
    1,522
    Hi Paulo, i made a mod of your ui with extra start and stop Buttons for the screencast..



    What do you and the others think?



  20. #60
    Member Bao2's Avatar
    Join Date
    Aug 2009
    Location
    Galicia - Spain
    Posts
    4,832
    Originally Posted by tungee View Post
    Hi Paulo, i made a mod of your ui with extra start and stop Buttons for the screencast..



    What do you and the others think?
    The first button "Screencast keys Status" is the start/stop button. So I think that would be a duplicate.
    I think it would be better change the text of the button "Screencast Keys Status" to "START Screencast" by default. Thento when pressed to run change the button text to "STOP Screencast". And again when pressed to stop change to "START Screencast".
    Last edited by Bao2; 16-Dec-10 at 17:34.
    >>> Neytiri WIP <<<
    When explanations are complex you know there is no Truth on it.
    Tangled Fan Art



Page 3 of 13 FirstFirst 12345 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •