View Full Version : V 5.0.0 assets placing (code) as invisible and then gone on restart of app
SilentRuin
November 7th, 2025, 22:20
V 5.0.0 assets placing (code) as invisible and then gone on restart of app
Moon Wizard
November 7th, 2025, 22:51
How are the assets placed in the code? Which API?
Regards,
JPG
SilentRuin
November 8th, 2025, 01:34
How are the assets placed in the code? Which API?
Regards,
JPG
I just did a quick search of the extension in question for "Image." These are the API's I used to place/manage assets.
Image.addLayerPaintStamp being the one that actually does the placement. Depending on the layer being persistent or temporary (various operations like move token and other things will remove it) it will be readded/deleted under different conditions. For sure the startup of the app is triggering (or not triggering) something that used to insure the temporary assets were still in place. I've not looked into that yet. But the washed out appearance is something I noticed right away. Something in intensity of transparent assets has changed. I do not wish to go back and recreate all my assets level of transparency.
C:\Old Machine\Dungeon and Dragon World\Fantasy Grounds Extensions\FantasyGroundsExtensions\Generic Actions Extension\Data\extensions\Unpacked\GenericActionsL ayer\scripts\manager_generic_actions_layer.lua (33 hits)
Line 577: local nGALayerID = Image.getLayerByName(sPath, sLayerName);
Line 581: Image.deleteLayer(sPath, nGALayerID);
Line 585: local nGALayerID = Image.getLayerByName(sPath, sGenericActionsLayerGMOnly);
Line 587: Image.deleteLayer(sPath, nGALayerID);
Line 591: local nGALayerID = Image.getLayerByName(sPath, sGenericActionsLayerEffectsGMOnly);
Line 593: Image.deleteLayer(sPath, nGALayerID);
Line 656: local nGridSize = Image.getGridSize(SourceToken.getContainerNode());
Line 711: local nLayerIDPtr = Image.getLayerByName(sPath, sLayerPtr);
Line 713: nLayerIDPtr = Image.addLayer(sPath, "paint", { name = sLayerPtr });
Line 730: nPtrAssetWidth = (nSize / Image.getDistanceBaseUnits(imageControl.getDatabas eNode()) + ((nTokenSize + TokenManager.getTokenSpace(SourceToken) * Image.getDistanceBaseUnits(imageControl.getDatabas eNode()))/2)/ Image.getGridSize(imageControl.getDatabaseNode())) * 2;
Line 733: nPtrAssetWidth = nSize / Image.getDistanceBaseUnits(imageControl.getDatabas eNode()) * 2;
Line 735: nPtrAssetWidth = nSize / Image.getDistanceBaseUnits(imageControl.getDatabas eNode());
Line 749: Image.addLayerPaintStamp(sPath, nLayerIDPtr, { asset=sPtrResultAsset, w=w, h=h, x=nPtrx, y=nPtry, angle=nPtrAngle});
Line 921: nAssetWidth = (nSize / Image.getDistanceBaseUnits(imageControl.getDatabas eNode()) + ((nTokenSize + TokenManager.getTokenSpace(SourceToken) * Image.getDistanceBaseUnits(imageControl.getDatabas eNode()))/2)/ Image.getGridSize(imageControl.getDatabaseNode())) * 2;
Line 924: nAssetWidth = nSize / Image.getDistanceBaseUnits(imageControl.getDatabas eNode()) * 2;
Line 926: nAssetWidth = nSize / Image.getDistanceBaseUnits(imageControl.getDatabas eNode());
Line 1009: local nGALayerID = Image.getLayerByName(sPath, sGenericActionsLayer .. "_" .. sLayerMatchName .. "_" .. rSource.sName);
Line 1011: Image.deleteLayer(sPath, nGALayerID);
Line 1013: local nGALayerID = Image.getLayerByName(sPath, sGenericActionsLayerGMOnly .. "_" .. sLayerMatchName .. "_" .. rSource.sName);
Line 1015: Image.deleteLayer(sPath, nGALayerID);
Line 1025: local nLayerID = Image.getLayerByName(sPath, sLayer);
Line 1028: nLayerID = Image.addLayer(sPath, "paint", { name = sLayer, gmonly=true});
Line 1030: nLayerID = Image.addLayer(sPath, "paint", { name = sLayer });
Line 1049: Image.addLayerPaintStamp(sPath, nLayerID, { asset=sAsset, w=w, h=h, x=x, y=y, angle=nAssetAngle});
Line 1275: local nGridSize = Image.getGridSize(SourceToken.getContainerNode());
Line 1622: local nLayerID = Image.getLayerByName(sPath, sLayer);
Line 1628: local nLayerID = Image.getLayerByName(sPath, sLayer);
Line 1920: local nGALayerID = Image.getLayerByName(sDeletedLayer.sPath, sDeletedLayer.sLayerName);
Moon Wizard
November 8th, 2025, 02:04
I think Carl's going to need more help setting this one up to look at the issue. It seems different than the other one reported.
Maybe a 10-15 second video of a couple examples? Or a sample campaign with a recent copy of the extension and steps to see the issue?
Just trying to find the best way to address your issue quickly; without all the back and forth.
Thanks,
JPG
SilentRuin
November 8th, 2025, 03:32
I think Carl's going to need more help setting this one up to look at the issue. It seems different than the other one reported.
Maybe a 10-15 second video of a couple examples? Or a sample campaign with a recent copy of the extension and steps to see the issue?
Just trying to find the best way to address your issue quickly; without all the back and forth.
Thanks,
JPG
Will try to get that tomorrow
Moon Wizard
November 8th, 2025, 04:16
Just pushed a new client with several fixes that Carl provided. We're not sure if they fix the issue that you were having; without having an example test case to check.
Please run a new Check for Updates, and let us know.
Regards,
JPG
SilentRuin
November 8th, 2025, 04:19
I think Carl's going to need more help setting this one up to look at the issue. It seems different than the other one reported.
Maybe a 10-15 second video of a couple examples? Or a sample campaign with a recent copy of the extension and steps to see the issue?
Just trying to find the best way to address your issue quickly; without all the back and forth.
Thanks,
JPG
The best clue I can give you is that once I place the asset through Generic Actions Layer code it looks crystal clear as normally it should...
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=65747&d=1762575325
But once I click on token its like an invisible cellophane mask drops over it to blur it...
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=65748&d=1762575419
So technically the code placed it correct - but something with FGU blurred it afterwards. No idea what or why. Like the reach of the token put a blur on it.
SilentRuin
November 8th, 2025, 05:11
Based on what pindercarl is telling me the cleaner asset vision is because it is duplicated somehow - and when I click on token it gets put back to single (my extension will be removing the layer and replacing it - without a duplicate evidently). So the Clean look is not the actual look of the asset. I can see this by placing the asset as a layer stamp on the map and its faded out (due to transparency setting I guess). I've never noticed? Because it only happens after you replace the original placement via an effect call (likely being triggered twice somehow when triggered through button on actions spell)?
So... PinderCarl can stop looking at this. I don't understand why looking at the asset or playing the webm asset in my windows machine makes it look and play clean and crisp - but once I place it as webm asset in FGU it looks washed out. Unless of course its duplicated I guess? Even weirder discord showed it crisp but not after it is "played".
Confused. But I guess if that's how it is - that's how it is.
pindercarl
November 8th, 2025, 05:28
Based on what pindercarl is telling me the cleaner asset vision is because it is duplicated somehow - and when I click on token it gets put back to single (my extension will be removing the layer and replacing it - without a duplicate evidently). So the Clean look is not the actual look of the asset. I can see this by placing the asset as a layer stamp on the map and its faded out (due to transparency setting I guess). I've never noticed? Because it only happens after you replace the original placement via an effect call (likely being triggered twice somehow when triggered through button on actions spell)?
So... PinderCarl can stop looking at this. I don't understand why looking at the asset or playing the webm asset in my windows machine makes it look and play clean and crisp - but once I place it as webm asset in FGU it looks washed out. Unless of course its duplicated I guess? Even weirder discord showed it crisp but not after it is "played".
Confused. But I guess if that's how it is - that's how it is.
I did verify in the campaign you provided that there is a duplicate paint stamp when then campaign is opened. You may not have noticed previously, as the asset in GenericActionsLayerImagesExtra.mod (that you gave me last year) doesn't have the same transparency as the one you provided today, it is more opaque. I don't know when the asset changed.
SilentRuin
November 8th, 2025, 05:36
I did verify in the campaign you provided that there is a duplicate paint stamp when then campaign is opened. You may not have noticed previously, as the asset in GenericActionsLayerImagesExtra.mod (that you gave me last year) doesn't have the same transparency as the one you provided today, it is more opaque. I don't know when the asset changed.
It changed a while back when I realized multiple effects can be on a token at the same time and i wanted to see them all so added shotcut opacity (less) to each of the effect assets so they could see through to others under them (see them all). I can't believe I never noticed that much duller appearance when I did that but I guess I just never noticed because of this "duplication" causing it to still look clean when any effect was initially placed. Any tricks to not make something that is transparent remain sharp and colorful? I guess I'll have to go back and redo all the effects to some higher opacity to get a cleaner look? I swear this was not as dull but I admit this is not your issue. I must never have noticed after the intial placement due to duplication bug. Typical with my luck (sigh)
Thanks for the help - sorry to waste your time.
Moon Wizard
November 8th, 2025, 05:41
No worries. Thanks for the extra work helping us track down the situation.
JPG
pindercarl
November 8th, 2025, 05:47
It changed a while back when I realized multiple effects can be on a token at the same time and i wanted to see them all so added shotcut opacity (less) to each of the effect assets so they could see through to others under them (see them all). I can't believe I never noticed that much duller appearance when I did that but I guess I just never noticed because of this "duplication" causing it to still look clean when any effect was initially placed. Any tricks to not make something that is transparent remain sharp and colorful? I guess I'll have to go back and redo all the effects to some higher opacity to get a cleaner look? I swear this was not as dull but I admit this is not your issue. I must never have noticed after the intial placement due to duplication bug. Typical with my luck (sigh)
Thanks for the help - sorry to waste your time.
The API addLayerPaintStamp does allow you to pass in a color in the table using the key "color." You should be able to pass in white with an alpha and use the original asset. It would be something like color="7fffffff" for 50% opacity, or color="c0ffffff" for 75% opacity. It would allow you to experiment with the transparency without having to adjust the original asset. The table format for the API is:
{ asset = <string>, x = <number>, y = <number>, [w = <number>, h = <number>], [color = <color>], [angle = <number>], [fade = <number>] }
SilentRuin
November 8th, 2025, 05:54
The API addLayerPaintStamp does allow you to pass in a color in the table using the key "color." You should be able to pass in white with an alpha and use the original asset. It would be something like color="7fffffff" for 50% opacity, or color="c0ffffff" for 75% opacity. It would allow you to experiment with the transparency without having to adjust the original asset. The table format for the API is:
{ asset = <string>, x = <number>, y = <number>, [w = <number>, h = <number>], [color = <color>], [angle = <number>], [fade = <number>] }
I may look into that at some point because that would have been much easier than changing all the assets that might be overlayed (effects) in shotcut to a hardcoded transparent opacity. The fact nobody - including me - noticed the severe dull color clarity downgrade when I did this tells me it must not be that big a deal. Or like me that duplicate bug made them see the initial pretty then not notice the change later to dullness. Thanks again. Appreciate you finding the duplicate as the explanation that the dull version was the real version and the crisp version was the duplicate version. I would never have found it.
I will probably call that bug a clever feature to see what "might have been" for the crisp clarity of the asset (sigh) ;)
SilentRuin
November 8th, 2025, 18:31
The API addLayerPaintStamp does allow you to pass in a color in the table using the key "color." You should be able to pass in white with an alpha and use the original asset. It would be something like color="7fffffff" for 50% opacity, or color="c0ffffff" for 75% opacity. It would allow you to experiment with the transparency without having to adjust the original asset. The table format for the API is:
{ asset = <string>, x = <number>, y = <number>, [w = <number>, h = <number>], [color = <color>], [angle = <number>], [fade = <number>] }
Are your hex values different than normal alpha settings? I know there are two different ways to define the alpha layer vs color layers and based on what you showed me above I took it that out of #RRGGBBAA or #AARRGGBB standard formats you are using the #AARRGGBB format?
Also for whatever opacity setting you use (A=alpha, R=red, G=green, B=blue) I note you showed 7f for 50% and C0 for 70% - if that is right can you show me what that is based on for 75% and 50%? Based on the usual hex values for opacity these would be BF and 80 but you show 7F and C0 - so I'm not sure what to actually use if I go this route.
All hex value from 100% to 0% alpha:
sample
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
91% — E8
90% — E6
89% — E3
88% — E0
87% — DE
86% — DB
85% — D9
84% — D6
83% — D4
82% — D1
81% — CF
80% — CC
79% — C9
78% — C7
77% — C4
76% — C2
75% — BF
74% — BD
73% — BA
72% — B8
71% — B5
70% — B3
69% — B0
68% — AD
67% — AB
66% — A8
65% — A6
64% — A3
63% — A1
62% — 9E
61% — 9C
60% — 99
59% — 96
58% — 94
57% — 91
56% — 8F
55% — 8C
54% — 8A
53% — 87
52% — 85
51% — 82
50% — 80
49% — 7D
48% — 7A
47% — 78
46% — 75
45% — 73
44% — 70
43% — 6E
42% — 6B
41% — 69
40% — 66
39% — 63
38% — 61
37% — 5E
36% — 5C
35% — 59
34% — 57
33% — 54
32% — 52
31% — 4F
30% — 4D
29% — 4A
28% — 47
27% — 45
26% — 42
25% — 40
24% — 3D
23% — 3B
22% — 38
21% — 36
20% — 33
19% — 30
18% — 2E
17% — 2B
16% — 29
15% — 26
14% — 24
13% — 21
12% — 1F
11% — 1C
10% — 1A
9% — 17
8% — 14
7% — 12
6% — 0F
5% — 0D
4% — 0A
3% — 08
2% — 05
1% — 03
0% — 00
pindercarl
November 8th, 2025, 18:41
Are your hex values different than normal alpha settings? I know there are two different ways to define the alpha layer vs color layers and based on what you showed me above I took it that out of #RRGGBBAA or #AARRGGBB standard formats you are using the #AARRGGBB format?
Also for whatever opacity setting you use (A=alpha, R=red, G=green, B=blue) I note you showed 7f for 50% and C0 for 70% - if that is right can you show me what that is based on for 75% and 50%? Based on the usual hex values for opacity these would be BF and 80 but you show 7F and C0 - so I'm not sure what to actually use if I go this route.
All hex value from 100% to 0% alpha:
sample
100% — FF
99% — FC
98% — FA
97% — F7
96% — F5
95% — F2
94% — F0
93% — ED
92% — EB
91% — E8
90% — E6
89% — E3
88% — E0
87% — DE
86% — DB
85% — D9
84% — D6
83% — D4
82% — D1
81% — CF
80% — CC
79% — C9
78% — C7
77% — C4
76% — C2
75% — BF
74% — BD
73% — BA
72% — B8
71% — B5
70% — B3
69% — B0
68% — AD
67% — AB
66% — A8
65% — A6
64% — A3
63% — A1
62% — 9E
61% — 9C
60% — 99
59% — 96
58% — 94
57% — 91
56% — 8F
55% — 8C
54% — 8A
53% — 87
52% — 85
51% — 82
50% — 80
49% — 7D
48% — 7A
47% — 78
46% — 75
45% — 73
44% — 70
43% — 6E
42% — 6B
41% — 69
40% — 66
39% — 63
38% — 61
37% — 5E
36% — 5C
35% — 59
34% — 57
33% — 54
32% — 52
31% — 4F
30% — 4D
29% — 4A
28% — 47
27% — 45
26% — 42
25% — 40
24% — 3D
23% — 3B
22% — 38
21% — 36
20% — 33
19% — 30
18% — 2E
17% — 2B
16% — 29
15% — 26
14% — 24
13% — 21
12% — 1F
11% — 1C
10% — 1A
9% — 17
8% — 14
7% — 12
6% — 0F
5% — 0D
4% — 0A
3% — 08
2% — 05
1% — 03
0% — 00
Your numbers look fine. I was using 127 as 50% and 192 as 75%, so different by 1 decimal value. The format is AARRGGBB.
SilentRuin
November 8th, 2025, 19:11
Your numbers look fine. I was using 127 as 50% and 192 as 75%, so different by 1 decimal value. The format is AARRGGBB.
Excellent. I'll provide and option to allow setting transparency for effects (non effects will be left at full opacity as the asset is defined).
OptionsManager.registerOption2("GENERIC_ACTIONS_LAYER_EFFECT_OPACITY", false, "option_verify",
"option_label_generic_actions_layer_effect_opacity", "option_entry_cycler",
{ labels = "option_val_alphaopacity85|option_val_alphaopacity7 5|option_val_alphaopacity50|option_val_alphaopacit y25", values = "D9|BF|80|40",
baselabel = "option_val_alphaopacity100", baseval = "FF", default = "FF" });
...
-- color is #AARRGGBB (A=alpha, R=red, G=green, B=blue)
local sColor = "FFFFFFFF"; -- default is full opacity or asset remains as it was defined in terms of transparency
-- if an effect check opacity option (used how transparent to make effect asset which can be overlayed over other effect)
if sLayerName == sGenericActionsLayerEffects or sLayerName == sGenericActionsLayerEffectsGMOnly then
local sAlpha = OptionsManager.getOption("GENERIC_ACTIONS_LAYER_EFFECT_OPACITY");
if sAlpha then
sColor = sAlpha .. "FFFFFF";
end
end
...
Image.addLayerPaintStamp(sPath, nLayerID, { asset=sAsset, w=w, h=h, x=x, y=y, color=sColor, angle=nAssetAngle});
Tested and works perfectly. Now I just have to change the opacity back to full on all my raw effect assets (as this is starting with that opacity as 100%).
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.