POV-Ray : Newsgroups : povray.general : height_field name in a macro Server Time
1 Jun 2024 13:36:57 EDT (-0400)
  height_field name in a macro (Message 1 to 6 of 6)  
From: Alexis
Subject: height_field name in a macro
Date: 2 Feb 2015 17:00:00
Message: <web.54cff22e70575c0d9fbf62e70@news.povray.org>
Here is a simplified version of a macro I wrote:

#macro my_macro(picture_name)
  #local my_hf = height_field {picture_name};
  ...
#end

When I call the macro with some picture name :
  my_macro("the_pict_name")
I get the following error message :

"Parse Error: Expected 'map file spec', string identifier found instead"

I get no error when I replace the line inside the macro with :

  #local my_hf = height_field {"the_pict_name"};
  ...


I've tried to put the picture with my application include files and in other
folders of my system include files with the same result.
By the way, I use Pov_Ray 3.7 unofficial on a mac.
Any idea to solve this problem ?

Thanks for your help.


Post a reply to this message

From: Le Forgeron
Subject: Re: height_field name in a macro
Date: 2 Feb 2015 17:27:22
Message: <54cff9ca$1@news.povray.org>
Le 02/02/2015 22:56, Alexis a écrit :
> Here is a simplified version of a macro I wrote:
> 
> #macro my_macro(picture_name)
>   #local my_hf = height_field {picture_name};
>   ...
> #end
> 
> When I call the macro with some picture name :
>   my_macro("the_pict_name")
> I get the following error message :
> 
> "Parse Error: Expected 'map file spec', string identifier found instead"
> 
> I get no error when I replace the line inside the macro with :
> 
>   #local my_hf = height_field {"the_pict_name"};
>   ...
> 
> 
> I've tried to put the picture with my application include files and in other
> folders of my system include files with the same result.
> By the way, I use Pov_Ray 3.7 unofficial on a mac.
> Any idea to solve this problem ?
> 
> Thanks for your help.

Can you try to add the "optional" file type before the filename ?
(if it works, you would need to specialise your macro on file type)

something like

height_field{ png picture_name }


Post a reply to this message

From: clipka
Subject: Re: height_field name in a macro
Date: 2 Feb 2015 20:25:09
Message: <54d02375@news.povray.org>
Am 02.02.2015 um 23:27 schrieb Le_Forgeron:

> Can you try to add the "optional" file type before the filename ?
> (if it works, you would need to specialise your macro on file type)
>
> something like
>
> height_field{ png picture_name }

Sounds like a bug to me. If height field's file type is optional when 
using a string literal for the filename, it should just as well be 
optional when using a string variable.

Shall we draw straws who gets to fix this?


Post a reply to this message

From: clipka
Subject: Re: height_field name in a macro
Date: 2 Feb 2015 21:07:42
Message: <54d02d6e@news.povray.org>
Am 03.02.2015 um 02:25 schrieb clipka:
> Am 02.02.2015 um 23:27 schrieb Le_Forgeron:
>
>> Can you try to add the "optional" file type before the filename ?
>> (if it works, you would need to specialise your macro on file type)
>>
>> something like
>>
>> height_field{ png picture_name }
>
> Sounds like a bug to me. If height field's file type is optional when
> using a string literal for the filename, it should just as well be
> optional when using a string variable.
>
> Shall we draw straws who gets to fix this?

Never mind. Fixed this already.


Post a reply to this message

From: clipka
Subject: Re: height_field name in a macro
Date: 2 Feb 2015 21:14:28
Message: <54d02f04$1@news.povray.org>
Am 02.02.2015 um 22:56 schrieb Alexis:
> Here is a simplified version of a macro I wrote:
>
> #macro my_macro(picture_name)
>    #local my_hf = height_field {picture_name};
>    ...
> #end
>
> When I call the macro with some picture name :
>    my_macro("the_pict_name")
> I get the following error message :
>
> "Parse Error: Expected 'map file spec', string identifier found instead"

As a workaround until the brand new fix is available in a Mac release, try:

    #local my_hf = height_field { concat(picture_name,"") };

Don't ask why...


Post a reply to this message

From: Alexis
Subject: Re: height_field name in a macro
Date: 3 Feb 2015 03:50:00
Message: <web.54d08b2f835b497b9b490fcd0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

> As a workaround until the brand new fix is available in a Mac release, try:
>
>     #local my_hf = height_field { concat(picture_name,"") };
>
> Don't ask why...

OK, I don't ask why, but I thank you: it works!


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.