[chimera-dev] [Chimera-users] keyboard shortcuts

Tom Goddard goddard at sonic.net
Tue Dec 31 12:29:28 PST 2013


Hi Matt,

  I agree that difficulty of use kills interest in stereo -- needs to be as simple as binoculars, one knob.

  For recording transparent background animations currently you have to click the "Transparent background" button in the File / Save Image dialog.  That switches Chimera rendering to use a frame buffer that includes transparency.  You also will need to use PNG format for the movie recording images ("movie record format PNG") because that is the only recording format that handles transparency.  Currently there is no command to set background transparency.  We should add a "set backgroundTransparency true|false" command to do this so you can put it in a script.  It will call the setBackgroundOpacity() routine in chimera/printer.py.  Until that is added you could use a little Python script transpbg.py:

from chimera import printer
printer.setBackgroundOpacity(True)

and call it from your movie command script with "open transpbg.py"

  The Chimera programming questions should go to chimera-dev at cgl.ucsf.edu to avoid spamming Chimera users who are not interested in programming issues.

	Tom


On Dec 31, 2013, at 12:07 PM, "Dougherty, Matthew T" <matthewd at bcm.edu> wrote:

> probably going to stick with the spreadsheet as my starting point for design and documentation. 
> Mapping the USB commands has to be hand crafted in concert with other non-chimera software manufacturer software.
> The spreadsheet will allow me to deal with the mishmash, chimera commands, OS interactions, serial S3D serial/USB commands to projector.
> 
> As for S3D, my analysis is that jumping through all the hoops is so awkward this is the main reason people don't mess with it.
> One button to get in and out, turn a knob like a pair of binoculars. 
> Now that I got an 8ft rotating dome in my office, I am building a viz cockpit to push interactivity, s3D and volume rendering.
> 
> just about finished with my first operational prototype, "UCP", user control panel.  Will send it to chimera-dev for review.
> it deals with a bunch of camera issues, particularly S3D so I can explore a range of interaxial distances.
> It also gives me fine control of volume rendering, so I can accurately pull out stuff I would normally give up on.
> Starting to feel pretty good about programming chimera extensions, at some point I plan to tackle the frame packing and a rework of space navigator.
> 
> couple other things.  
> 
> 1) When I need to generate animations that have a transparent background I go to save image and set the transparency background.  Sometimes I forget to do this and waste a lot of time on my rendering. 
> 
> I would like to add a new animation command to so I can set the transparency in my .com files.  What is the chimera variable I need to set?
> Also plan similar commands to set the screensize, screen distance and eye separation; but know how to do those.
> 
> 2) These kinds of posts, should I be sending them to chimera-users or chimera-dev?
> 
> 
> 
> Matthew Dougherty
> National Center for Macromolecular Imaging
> Baylor College of Medicine
> ________________________________________
> From: Tom Goddard 
> Sent: Tuesday, December 31, 2013 1:36 PM
> To: Dougherty, Matthew T
> Subject: Re: [Chimera-users] keyboard shortcuts
> 
> Ok.  You might have your code use:
> 
> for k in ('!001', '!002', '!003'):
>        add(k, 'HID', lambda: HID(k))
> 
> or if they really are just numbered
> 
> for k in range(25):
>        s = '!%03d' % k
>        add(s, 'HID', lambda: HID(s))
> 
>  Tom
> 
> 
> On Dec 31, 2013, at 11:29 AM, "Dougherty, Matthew T" wrote:
> 
>> thx, I can generate that in a spreadsheet and paste it in.
>> 
>> add(
>>           '!001', 'HID', lambda: HID('!001'),
>>           '!002', 'HID', lambda: HID('!002'),
>>                ...
>> )
>> 
>> 
>> suggestion on chimera2, if you are going to use keyboard shortcuts I would recommend changing the ordering so the description is the last item.  This makes it easier to read because the text and def tend to be 2-6 characters so the columns line up, and the descriptions lengths are hi;ghrange from 3-30 characters.
>> 
>> Matthew Dougherty
>> National Center for Macromolecular Imaging
>> Baylor College of Medicine
>> ________________________________________
>> From: Tom Goddard 
>> Sent: Tuesday, December 31, 2013 12:26 PM
>> To: Dougherty, Matthew T
>> Subject: Re: [Chimera-users] keyboard shortcuts
>> 
>> There is no way to fetch the last keyboard shortcut typed.  But you can achieve the same thing with the code I gave in the previous message.
>> 
>>       Tom
>> 
>> 
>> On Dec 31, 2013, at 2:06 AM, "Dougherty, Matthew T"  wrote:
>> 
>>> Hi Tom,
>>> 
>>> attached is what I am doing now.
>>> 
>>> 
>>> Would like to do this instead
>>> 
>>> def register_accelerators():
>>> accelerators = [
>>>                ('!001',HID,'HID'),
>>>                ('!002',HID,'HID'),
>>>                ('!003',HID,'HID'),
>>>                ('!004',HID,'HID'), ....
>>> 
>>> 
>>> def HID():
>>>  get keyboard shortcut text string
>>>  call Matt's def passing the text string
>>>  matt's def is part of another chimera extension TBD
>>> 
>>> 
>>> 
>>> 
>>> Matthew Dougherty
>>> National Center for Macromolecular Imaging
>>> Baylor College of Medicine
>>> ________________________________________
>>> From: Tom Goddard
>>> Sent: Monday, December 30, 2013 2:21 PM
>>> To: Dougherty, Matthew T
>>> Cc: chimera-users at cgl.ucsf.edu
>>> Subject: Re: [Chimera-users] keyboard shortcuts
>>> 
>>> Hi Matt,
>>> 
>>> I don't understand your question.  Is the idea that you want to register a single keyboard shortcut handler that handles many different shortcuts and takes the two-letter shortcut characters as an argument?  You would still need to register that function for every set of shortcut keys it handles.  You could do something like
>>> 
>>> from Accelerators import add_accelerator as add
>>> add('pq', 'Here is a description of what this shortcut does', lambda: myHandler('pq'))
>>> 
>>> The "lambda" business is Python code that creates a function, in this case taking no arguments.  And in this example it calls the funtion myHandler with argument "pq".
>>> 
>>>      Tom
>>> 
>>> 
>>> 
>>> On Dec 27, 2013, at 4:56 PM, "Dougherty, Matthew T" wrote:
>>> 
>>>> I am writing a bunch of USB-HID keyboard shortcuts for some extensions I am writing.
>>>> 
>>>> Usually one shortcut per def.  Since my decoding of HID is integrally tied to the extension, I would like to simplify all my shortcuts coming from one device to one def.
>>>> 
>>>> As of now if I have 100 button commands I have to 1) register 100 shortcuts, 2) create 100 defs, 3) do corresponding stuff in my extension.
>>>> I would prefer to call one def that passes the actual keyboard string to my extension, thereby simplifying my user accelerators to just registration.
>>>> 
>>>> How do I get the string within my keyboard shortcuts python file?
>>>> 
>>>> thanks,
>>>> 
>>>> 
>>>> Matthew Dougherty
>>>> National Center for Macromolecular Imaging
>>>> Baylor College of Medicine
>>>> _______________________________________________
>>>> Chimera-users mailing list
>>>> Chimera-users at cgl.ucsf.edu
>>>> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-users
>>>> 
>>> 
>>> <USB-HID-D5.py>
>> 
>> 
> 
> 





More information about the Chimera-dev mailing list