ImportImageFromFile3D

A place to post suggestions for new features, new bugs, and comments about the existing code.
Bunnywabbit
Posts: 965
Joined: Sun May 15, 2005 7:00 am
Location: Amsterdam, the Netherlands

Post by Bunnywabbit »

Hi,

We've had importimagefromfile, the png- enabling equivalent of importImage - for some time now.

However we don't have an equivalent for importimage3d.

This is the function that lets you dynamically change the colors in a given image to a colorvalue (e.g. hudColor) given as an argument.
i mention this here, because Ksero's mdl documentation does not.

for instance: the coloring of the background in the vanilla targetoval is handled by :

Code: Select all

TargetOvalColor = ImportImage3D("targetovalcolorbmp", targetHudColor, true);
It would be nice to have a importimagefromfile3d equivalent so we could
a) oneday completely switch to .png rather than bmp mdl
b) allow nifty shinyness to be applied to new huds.

thanks
ImageImage current version r158 new beta as of jan 23 2012
KGJV
Posts: 1474
Joined: Tue Jul 01, 2003 7:00 am
Location: Transilvania

Post by KGJV »

Bunnywabbit wrote:QUOTE (Bunnywabbit @ Apr 18 2010, 05:16 PM) Hi,

We've had importimagefromfile, the png- enabling equivalent of importImage - for some time now.

However we don't have an equivalent for importimage3d.

This is the function that lets you dynamically change the colors in a given image to a colorvalue (e.g. hudColor) given as an argument.
i mention this here, because Ksero's mdl documentation does not.

for instance: the coloring of the background in the vanilla targetoval is handled by :

Code: Select all

TargetOvalColor = ImportImage3D("targetovalcolorbmp", targetHudColor, true);
It would be nice to have a importimagefromfile3d equivalent so we could
a) oneday completely switch to .png rather than bmp mdl
b) allow nifty shinyness to be applied to new huds.

thanks
AFAIK I didn't add one because we can :

Code: Select all

TargetOvalColor = ImportImage3D(ImportImageFromFile("targetovalcolor.png",true), targetHudColor, true);
or

Code: Select all

targetovalcolorbmp = ImportImageFromFile("targetovalcolor.png",true);
TargetOvalColor = ImportImage3D(targetovalcolorbmp, targetHudColor, true);
Image
Bunnywabbit
Posts: 965
Joined: Sun May 15, 2005 7:00 am
Location: Amsterdam, the Netherlands

Post by Bunnywabbit »

both of those techniques crash the game.

The only way that works if if the ImportImageFromFile is in a separate textmdl in the artwork folder. Then you can import that using ImportImage3D.

unless my code has errors, but i did doublecheck it multiple times.

CODE
ShieldPic =
ImportImageFromFile("mods/Immersion/media/InHud_Shield.png", true);

InHudShield =
BlendImage(
ImportImage3D(
"InHud_Shield", //a text-mdl in Artwork: ImportImageFromFile("mods/Immersion/media/InHud_Shield.png", true)
//ShieldPic, //this crashes the game.
//ImportImageFromFile("mods/Immersion/media/InHud_Shield.png", true), // this crashes the game too.
hudColor,
true
),
BlendModeAdd
);

InHudCenterHudOn =
GroupImage ([
TranslateImage(InHudShield, Point(320,240))
]);



the point is starting to get slightly moot, however, since it appears to only be impossible to have this kind of coloring effect for static elements, not say, Gauges.

Unless ofcourse you could whip that up as well :)
Last edited by Bunnywabbit on Mon Apr 19, 2010 12:36 pm, edited 1 time in total.
ImageImage current version r158 new beta as of jan 23 2012
KGJV
Posts: 1474
Joined: Tue Jul 01, 2003 7:00 am
Location: Transilvania

Post by KGJV »

Bunnywabbit wrote:QUOTE (Bunnywabbit @ Apr 19 2010, 02:18 PM) both of those techniques crash the game.
I'll look into that. they shouldn't.
Bunnywabbit wrote:QUOTE (Bunnywabbit @ Apr 19 2010, 02:18 PM) the point is starting to get slightly moot, however, since it appears to only be impossible to have this kind of coloring effect for static elements, not say, Gauges.

Unless ofcourse you could whip that up as well :)
I dunno, that whole alpha/transparency is kinda a fortunate 'side effect' of the new engine. I'll look into Gauge code to see why.
Image
Bunnywabbit
Posts: 965
Joined: Sun May 15, 2005 7:00 am
Location: Amsterdam, the Netherlands

Post by Bunnywabbit »

Thanks a lot,

I really appreciate your help!
ImageImage current version r158 new beta as of jan 23 2012
KGJV
Posts: 1474
Joined: Tue Jul 01, 2003 7:00 am
Location: Transilvania

Post by KGJV »

KGJV wrote:QUOTE (KGJV @ Apr 19 2010, 02:48 PM) I'll look into that. they shouldn't.
they should actually ... 1st parameter of ImportImage3D must be of type String. I thought it could be any expression that evaluate to an image.My bad.

so text mdl like you did is the only way to load a png with ImportImage3D.

AS for Gauge, try with GaugeImageRect instead of GaugeImage may be ? (check forums for GaugeImageRect too, some known issues here).
Image
Bunnywabbit
Posts: 965
Joined: Sun May 15, 2005 7:00 am
Location: Amsterdam, the Netherlands

Post by Bunnywabbit »

allright then. So is this going in the suggestion box?


wrt to the gauges: tried that already, didn't work :) . Bit of a shame, because i had a really sweet idea for a HUD...
ImageImage current version r158 new beta as of jan 23 2012
Bunnywabbit
Posts: 965
Joined: Sun May 15, 2005 7:00 am
Location: Amsterdam, the Netherlands

Post by Bunnywabbit »

bump.

shall i make a ticket, then?
ImageImage current version r158 new beta as of jan 23 2012
Imago
Posts: 1440
Joined: Tue Sep 23, 2003 7:00 am
Location: Minneapolis, MN
Contact:

Post by Imago »

yes, please make a ticket. :lol:

not all depths are supported, color related code NYI, etc, etc

EDIT: IIRC Bunny and I have been down this road once before - and we were able to get-r-done.
Last edited by Imago on Tue Dec 07, 2010 12:23 pm, edited 1 time in total.
Image

These bugs haven't been fixed yet because don't have any developers interested in fixing them up. --Tigereye
Imago's stupid-sensor is supersensitive. --RealPandemonium
The art is managing the flow of the drama to achieve the desired results. --Big_Beta_Tester
joeld wrote:But we’ve been amazed at the level to which some of the Allegiance fans have remained hard-core.
Bunnywabbit
Posts: 965
Joined: Sun May 15, 2005 7:00 am
Location: Amsterdam, the Netherlands

Post by Bunnywabbit »

Imago wrote:QUOTE (Imago @ Dec 7 2010, 01:22 PM) yes, please make a ticket. :lol:

not all depths are supported, color related code NYI, etc, etc

EDIT: IIRC Bunny and I have been down this road once before - and we were able to get-r-done.
I've been nagging about Transparency for a while now, because i believe the visuals turn a lot of potential new players off, and we need better ones. A lot of work has been done on models and textures, but it's all kind of moot if the interface still looks like something out of Buck Rogers.

(sigh: google images Buck Rogers for the not-as-old-as-I-am)

I don't recall we actually got something done. It's more like we hit upon a workaround. One that I'm using rather a lot now in the Glass Hud. I'd prefer however not to litter importmdls all over the artwork folder.
ImageImage current version r158 new beta as of jan 23 2012
Post Reply