![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message
news:4aeea8ac$1@news.povray.org...
> This is a bit similar to SharkD's question above, but I wonder if it is
> possible.
>
> What I want to do is the following:
>
> #local PoserName = "Beggar_";
> #include concat(PoserName, "POV_geom.inc")
> #local ObjName = object {PoserName}
>
> The first two line of code work correctly, but the third one generates a
> parse error of course, as a string identifier instead of an object is
> found. How can I make this work?
>
> --
> All the best,
>
> Thomas
>
I assume that an object called 'Beggar_' is declared within the include
file?
If so you could use the Parse_String(String) macro. This macro takes a
string, writes it to a file, and then includes that file, effectively
evaluating the string, so:
#include "strings.inc"
Parse_String(concat("object {",PoserName,"}"))
should do it. Warning. I didn't test this for syntax errors.
Regards,
Chris B.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Stephen" <mca### [at] aolDOT com> schreef in bericht
news:4aeeb3a2$1@news.povray.org...
> problem with wanting to include a frame number in the name of the object
> (in PovRay) until I saw that you can define in PoseRay what you want to
> name the object.
Yes, I know this posibility, but that is not my problem. I try to simplify a
POV-Ray test scene for Poser figures that I use regularly, where I simply
have to give the generic name of the figure only once.
Thomas
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thomas de Groot
Subject: Re: Convert string identifier to object name
Date: 2 Nov 2009 07:34:50
Message: <4aeed1ea@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Chris B" <nom### [at] nomail com> schreef in bericht
news:4aeec1dc@news.povray.org...
> I assume that an object called 'Beggar_' is declared within the include
> file?
Yes indeed.
> If so you could use the Parse_String(String) macro. This macro takes a
> string, writes it to a file, and then includes that file, effectively
> evaluating the string, so:
>
> #include "strings.inc"
> Parse_String(concat("object {",PoserName,"}"))
>
Perfect Chris! It works. I just changed my code line to:
#local ObjName = Parse_String(concat("object {",PoserName,"}"))
and used that for further work in the scene.
Thomas
PS I shall have to look into strings.inc to discover what more is hidden
there :-) Fact is that I do not know *everything* that POV-Ray offers....
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thomas de Groot wrote:
> "Stephen" <mca### [at] aolDOT com> schreef in bericht
> news:4aeeb3a2$1@news.povray.org...
>> problem with wanting to include a frame number in the name of the object
>> (in PovRay) until I saw that you can define in PoseRay what you want to
>> name the object.
>
> Yes, I know this posibility, but that is not my problem. I try to simplify a
> POV-Ray test scene for Poser figures that I use regularly, where I simply
> have to give the generic name of the figure only once.
>
> Thomas
>
>
--
Best Regards,
Stephen
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thomas de Groot schrieb:
> Perfect Chris! It works. I just changed my code line to:
>
> #local ObjName = Parse_String(concat("object {",PoserName,"}"))
>
> and used that for further work in the scene.
>
> Thomas
>
> PS I shall have to look into strings.inc to discover what more is hidden
> there :-) Fact is that I do not know *everything* that POV-Ray offers....
Fun facts to know:
The Parse_String macro actually "inlines" the string by writing it to a
temporary file, which it then includes.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message
news:4aeed1ea@news.povray.org...
>
> PS I shall have to look into strings.inc to discover what more is hidden
> there :-) Fact is that I do not know *everything* that POV-Ray offers....
>
Nor do I. :o)
That's one great thing about using such a mature application. It's got
depth. Lots of handy tricks and features just waiting to be explored.
Regards,
ChrisB.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thomas de Groot
Subject: Re: Convert string identifier to object name
Date: 2 Nov 2009 10:34:18
Message: <4aeefbfa@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Chris B" <nom### [at] nomail com> schreef in bericht
news:4aeedcf1$1@news.povray.org...
>
> Nor do I. :o)
> That's one great thing about using such a mature application. It's got
> depth. Lots of handy tricks and features just waiting to be explored.
>
Which makes one marvel (and slaver) at all those hidden goodies :-)
Thomas
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"clipka" <ano### [at] anonymous org> schreef in bericht
news:4aeedb78$1@news.povray.org...
> Fun facts to know:
>
> The Parse_String macro actually "inlines" the string by writing it to a
> temporary file, which it then includes.
Neat.
Thomas
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thomas de Groot <tDOTdegroot@interdotnlanotherdotnet> wrote:
> #local PoserName = "Beggar_";
> #include concat(PoserName, "POV_geom.inc")
> #local ObjName = object {PoserName}
What does the include file contain, specifically? If it contains a "raw"
object, you could also do this:
#local Obj = object { #include "include_file" };
Works only if the include file can be inserted there and the result is valid
SDL, of course.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Warp" <war### [at] tag povray org> schreef in bericht
news:4aef0add@news.povray.org...
> Thomas de Groot <tDOTdegroot@interdotnlanotherdotnet> wrote:
>> #local PoserName = "Beggar_";
>> #include concat(PoserName, "POV_geom.inc")
>> #local ObjName = object {PoserName}
>
> What does the include file contain, specifically? If it contains a "raw"
> object, you could also do this:
>
> #local Obj = object { #include "include_file" };
>
> Works only if the include file can be inserted there and the result is
> valid
> SDL, of course.
>
In the specific case of a geometry file for a Poser figure generated by
Poseray, this does not work (I tried). The file contains first a collection
of different mesh2's, all assembled into a union at the end, like this:
//Model assembly from the meshes
#declare Beggar_=
union {
object {......}
object {......}
object {......}
....etc
}
Thomas
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |