Page 1 of 4

A Quick method to remove the Background of existing instruments

Posted: Mon Mar 06, 2017 3:06 pm
by JackZ
Here' s a quick method to remove the Background color (screws, etc...) of an existing instrument using SKINMAN.

In other terms starting from this:
Capture00000.PNG
How to end end up with this:
Capture0000.PNG
Here's the method I used. You NEED to have SkinMan installed:
STEP 1: In AIR MANAGER , in The CREATE/EDIT tab
Select the instrument you want.

Caution! it is advised to make a CLONE of your original instrument first!
Working on a clone version of the original ensures you that your instrument won't be modified by a subsequent Internet update...

Then click on the Folder button and navigate to the Resources Folder
Capture00.PNG
Remember the location and name of the Background file to be modified, then launch SkinMan (You can use the supplied file below to save time.:
Capture01.PNG
Remove_Bezel_example.zip
(9.32 KiB) Downloaded 406 times

Re: A Quick method to remove the Background of existing instruments

Posted: Mon Mar 06, 2017 3:20 pm
by JackZ
continued:

In Skinman verify that the Ellipse shape is in the Normal Mode AND that its transparency (Master Alpha) is set to 50% (it's already made for you in the file)
Capture2.PNG
Import your background image to be modified from the resource folder of your cloned instrument and place it at the correct place and size if needed.
Then in the Tree window, place the ellipse shape under the image item (The ellipse should be placed upfront with a transparency of 50%)
Capture3.PNG
Resize the Ellipse to cover only the parts of the instrument you want to be "saved"
VERY IMPORTANT in the Tree windows make sure that the ellipse and the image are linked as shown, the ellipse should the "child" of your background image.
Capture4.PNG
Now here's the power of SKINMAN: Boolean operations! Since both graphical elements are linked,select the Ellipse in the Tree View, then choose Shape*(star) mode: It's magic!
Capture5.PNG

Re: A Quick method to remove the Background of existing instruments

Posted: Mon Mar 06, 2017 3:26 pm
by JackZ
Final Steps:

Select your image item in the Tree view,
The add some Dropped Shadow a Density of 50 to 60 is fine.

Adjust the sense of depth of the Bezel using the Offset parameter.
Remember: unless in very rare cases, the lighting conventionally comes from the top and from the left, so the direction should be left at -45 to create realistic shadows!
Capture6.PNG
You are finished. Export your new Background image to the instrument Resources folder, (The clone!) replacing the existing image. IMPORTANT!: Make sure that your file is saved under the PNG format with alpha channel
IMPORTANT: Use exactly the same name as the original version of the Background image, or else, you will be forced to modifiy the Logic.lua code!
Capture7.PNG

Re: A Quick method to remove the Background of existing instruments

Posted: Mon Mar 06, 2017 3:28 pm
by JackZ
Run the new instrument in Air Manager.

Congratulations, the background has been removed, and you even have dropping shadows to give the sense of depth 8-) !
Capture0000.PNG
Jacques (JackZ)

Re: A Quick method to remove the Background of existing instruments

Posted: Mon Mar 06, 2017 4:44 pm
by JackZ
A final Note:
You can also "save" the screws with your background image if needed:

Just repeat the Bolean operation for each screw, by copying the image primitive and adding each time a small ellipse mask of the size of one screw to "save" only the screw of the entire background.

Notice that the shadow offset for the screw is less (3 to 5) than for the bezel itself(8 to 10) since the depth is lesser.

Jacques
Capture8.PNG

Re: A Quick method to remove the Background of existing instruments

Posted: Mon Mar 06, 2017 6:55 pm
by docjl
Well done Jacques. It's exactly the technic I've used to make some holes in my ovh panel to let korrys brights when I modify the intensity of lighting.
It's someone of this forum who gave me this trick of "shape*"

Re: A Quick method to remove the Background of existing instruments

Posted: Mon Mar 06, 2017 10:12 pm
by JackZ
Tout à fait Jean-Luc, merci!
Le problème des instruments avec des textures/couleur de fond pas adaptées est récurrent, je suis content d'avoir trouvé cette astuce!

The problem of existing gauges with inadequate background color/texture is a recurring problem one can encounter when trying to setup a panel with gauges coming from different sources, I'm glad to have found a relatively easy way to solve it.


Jacques
PS: Ca avance tes panels ATR?

Re: A Quick method to remove the Background of existing instruments

Posted: Tue Mar 07, 2017 10:21 am
by docjl
JackZ wrote: Mon Mar 06, 2017 10:12 pm PS: Ca avance tes panels ATR?
Oui et non... Il est terminé, mais je ne trouve pas le temps de réaliser les tests et recherches de bugs.
La gestation est longue ! :D

Re: A Quick method to remove the Background of existing instruments

Posted: Tue Mar 07, 2017 2:06 pm
by russ
Great Jack....very well explained ! It really will make gauges "portable" and especially with AM 3.0 where a panel can have a background graphic. This can create a realistic look for the panel to "drop" these no-background instruments on.

Re: A Quick method to remove the Background of existing instruments

Posted: Tue Mar 07, 2017 4:33 pm
by JackZ
Thanks Russ, really appreciated!

Now, I guess that one (or many) volunteer(s) has to take the plundge and start "cleaning" the existing instruments to make them "background ready" for the forthcoming Version 3.0 8-) .

I also figured that with a simple variable in the code, one could create a parametric gauge, in order to choose (or not) to display the existing background. This is very handy for say cokpit Builders that doesn't wnat the bezel or background to be displayed.

You just have to put at the very begining of the code something like thae following, that's what I do in all of the instruments I develop (showing or not the Bezel, the screws, the background):

Code: Select all

-----------------------------------------------------
--    CUSTOMIZATION VARIABLE SECTION
-----------------------------------------------------
AM_Display_background=true -- Give this variable the value true if you want a background
------------------------------------------------------
-- END of CUSTOMIZATION SECTION
-- !!!DO NOT MODIFY BEYOND THIS POINT!!!
-------------------------------------------------------
if AM_Display_background then 
	img_add_fullscreen("ADFback2.png")
end

The neat thing IMHO would be to add some additional parameters (check buttons) in the instrument "Panels" Tab in AM, that would set a bunch of additional internal property variables such as AM_DISP_BCKGD,AM_DISP_SCREWS, AM_DISP_BEZEL, thus allowing the developer to determine if it is needed to display or not the background, screws, etc... by querying the instrument property via instrument_prop(property), without having the final user to dig into the code at all....

Jacques