Skip to content

Commit

Permalink
Updated for Flame 2022 now using Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ManChicken1911 committed Apr 17, 2021
1 parent 5aa4cf2 commit 7b3ea66
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 25 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ via Ethernet, so your SmartScope must be on the network.

## Installing

### Flame 2020
### Flame 2022

Autodesk has changed the way user Python scripts are added into the menus for
Flame 2020 and it's now even easier to install them and have them carry across
future versions.
Autodesk Flame 2022 has moved to Python 3.7 and SmartScope-Flame has been updated
as a result to match.

All you need to do is drop the script into the Flame shared python directory:

Expand All @@ -29,9 +28,9 @@ All you need to do is drop the script into the Flame shared python directory:
and then either relaunch Flame or use the hotkey Shift-Control-H-P to reload all
the Python hooks.

### Flame 2019 and below
### Flame 2020 and 2021

Please see the v1.1 release for compatible script and instructions.
Please see the v1.2 release for compatible script and instructions.


## Configuring
Expand Down
51 changes: 32 additions & 19 deletions smartscope-control.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/env python
# ******************************************************************************
#
# SmartScope Duo Controller for Flame v1.2
# Copyright (c) 2015-2019 Bob Maple (bobm-matchbox [at] idolum.com)
# SmartScope Duo Controller for Flame v1.3
# Copyright (c) 2015-2021 Bob Maple (bobm-matchbox [at] idolum.com)
#
# Adds an entry to the Flame menu allowing control of the Blackmagic Design
# SmartScope Duo 4K - for Flame 2020
# SmartScope Duo 4K - Updated for Flame 2022 (Python 3.7)


#### Configuration ####
Expand Down Expand Up @@ -69,42 +69,55 @@ def smartscope_handler( userData ):
return

if( 'mon_a' in userData ):
tcpSocket.send( "MONITOR A:\n" if ssdc_swap is False else "MONITOR B:\n" )
tcpSocket.send( "ScopeMode: " + userData['mon_a'] + "\n" )
tmpstr = "MONITOR A:\n" if ssdc_swap is False else "MONITOR B:\n"
tmpstr += "ScopeMode: " + userData['mon_a'] + "\n"
tcpSocket.send( tmpstr.encode( 'utf-8' ) )

if( 'mon_a_br' in userData ):
tcpSocket.send( "Brightness: " + userData['mon_a_br'] + "\n" )
tmpstr = "Brightness: " + userData['mon_a_br'] + "\n"
else:
tcpSocket.send( "Brightness: " + (ssdc_picture['brightness'] if userData['mon_a'] is "Picture" else ssdc_scope['brightness']) + "\n" )
tmpstr = "Brightness: " + (ssdc_picture['brightness'] if userData['mon_a'] is "Picture" else ssdc_scope['brightness']) + "\n"

tcpSocket.send( tmpstr.encode( 'utf-8' ) )

if( 'mon_a_cn' in userData ):
tcpSocket.send( "Contrast: " + userData['mon_a_cn'] + "\n" )
tmpstr = "Contrast: " + userData['mon_a_cn'] + "\n"
else:
tcpSocket.send( "Contrast: " + (ssdc_picture['contrast'] if userData['mon_a'] is "Picture" else ssdc_scope['contrast']) + "\n" )
tmpstr = "Contrast: " + (ssdc_picture['contrast'] if userData['mon_a'] is "Picture" else ssdc_scope['contrast']) + "\n"

tcpSocket.send( tmpstr.encode( 'utf-8' ) )

if( 'mon_a_xtra' in userData ):
tcpSocket.send( userData['mon_a_xtra'] + "\n" )
tmpstr = userData['mon_a_xtra'] + "\n"

tcpSocket.send( "\n" )
tmpstr += "\n"
tcpSocket.send( tmpstr.encode( 'utf-8' ) )

if( 'mon_b' in userData ):
tcpSocket.send( "MONITOR B:\n" if ssdc_swap is False else "MONITOR A:\n" )
tcpSocket.send( "ScopeMode: " + userData['mon_b'] + "\n" )
tmpstr = "MONITOR B:\n" if ssdc_swap is False else "MONITOR A:\n"
tmpstr += "ScopeMode: " + userData['mon_b'] + "\n"

tcpSocket.send( tmpstr.encode( 'utf-8' ) )

if( 'mon_b_br' in userData ):
tcpSocket.send( "Brightness: " + userData['mon_b_br'] + "\n" )
tmpstr = "Brightness: " + userData['mon_b_br'] + "\n"
else:
tcpSocket.send( "Brightness: " + (ssdc_picture['brightness'] if userData['mon_b'] is "Picture" else ssdc_scope['brightness']) + "\n" )
tmpstr = "Brightness: " + (ssdc_picture['brightness'] if userData['mon_b'] is "Picture" else ssdc_scope['brightness']) + "\n"

tcpSocket.send( tmpstr.encode( 'utf-8' ) )

if( 'mon_b_cn' in userData ):
tcpSocket.send( "Contrast: " + userData['mon_b_cn'] + "\n" )
tmpstr = "Contrast: " + userData['mon_b_cn'] + "\n"
else:
tcpSocket.send( "Contrast: " + (ssdc_picture['contrast'] if userData['mon_b'] is "Picture" else ssdc_scope['contrast']) + "\n" )
tmpstr = "Contrast: " + (ssdc_picture['contrast'] if userData['mon_b'] is "Picture" else ssdc_scope['contrast']) + "\n"

tcpSocket.send( tmpstr.encode( 'utf-8' ) )

if( 'mon_b_xtra' in userData ):
tcpSocket.send( userData['mon_b_xtra'] + "\n" )
tmpstr = userData['mon_b_xtra'] + "\n"

tcpSocket.send( "\n" )
tmpstr += "\n"
tcpSocket.send( tmpstr.encode( 'utf-8' ) )

time.sleep(0.2)
tcpSocket.close()
Expand Down

0 comments on commit 7b3ea66

Please sign in to comment.