[Closed] Horrible Hack-work-around Warning Message Required
I need to have a warning message appear when the Render Scene Dialog is opened…
It needs to test whether a Wacom tablet is currently plugged in, and if so display an error.
Anyone got any ideas how to check for this?
I’ve found this code for detecting hardware but I’m struggling to find out from MSDN how to check for Human Interface devices.
Fn GetHardwareProp HwClass HwProp = (
local HwInfo,HwInfoEnumerator,OutArray
OutArray = #()
try ( HwInfo = (DotNetObject "System.Management.ManagementClass" HwClass).GetInstances() ) Catch (
DotNet.LoadAssembly "System.Management.dll"
HwInfo = (DotNetObject "System.Management.ManagementClass" HwClass).GetInstances()
)
HwInfoEnumerator = HwInfo.GetEnumerator()
while (HwInfoEnumerator.MoveNext()) do (
for prop in HwProp do (
local TempString = try( HwInfoEnumerator.Current.Item[prop] as string ) catch()
if TempString != "" do (
append OutArray prop
append OutArray TempString
)
)
)
OutArray
)
cpuInfo = GetHardwareProp "Win32_Processor" #("ProcessorID", "Name", "Revision", "SystemName")
gpuInfo = GetHardwareProp "Win32_VideoController" #("AdapterRAM", "PNPDeviceID", "Name")
mbInfo = GetHardwareProp "Win32_BaseBoard" #("Manufacturer", "Product")
procID = cpuInfo[(findItem cpuInfo "ProcessorID")+1] ; procName = cpuInfo[(findItem cpuInfo "Name")+1]
procRevision = cpuInfo[(findItem cpuInfo "Revision")+1] ; sysName = cpuInfo[(findItem cpuInfo "SystemName")+1]
gpuRAM = gpuInfo[(findItem gpuInfo "AdapterRAM")+1] ; gpuID = gpuInfo[(findItem gpuInfo "PNPDeviceID")+1]
gpuName = gpuInfo[(findItem gpuInfo "Name")+1] ; mbManu = mbInfo[(findItem mbInfo "Manufacturer")+1]
mbName = mbInfo[(findItem mbInfo "Product")+1]
I’m not sure how that will work with the wacom plugged in/out.
The reason for this is with Windows 10 + Max 2014 + Wacom tablet plugged in, if you open the render scene dialog and add a render element, max will crash every time. So what I want to do is to make a check that gets called when the render scene dialog gets opened to see if a wacom is plugged in and then display a message prompting the user to unplug their wacom if they need to touch the render element tab to avoid max crashing.
Maybe the next level would be to automatically disable the wacom when the render scene dialog is open, I’ll have to see if that’s possible or not.
You could try this:
I haven’t worked on this before, but just checked the C# API of Wintab (WintabDN), and there is a method in the CWintabInfo Class that tells you if a Tabled is connected CWintabInfo.IsWintabAvailable().
Didn’t test it too much, but worked well when plugged-unplugged a tablet.