|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I am working on my own little animation framework for astronomy related
scenes.
I would like the ability to pass a macro name to another macro that will:
1) do some animation-related setup and housekeeping
2) call the macro passed as parameter
3) do some more animation-related setup and housekeeping
Unfortunately I have not found a way to pass a macro name as parameter
and be able to call it. Is this use case really beyond the capabilities
of the language, or I just have to find the right syntax?
Thank you
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Alessio Sangalli <man### [at] gmailcom> wrote:
3) do some more animation-related setup and housekeeping
>
> Unfortunately I have not found a way to pass a macro name as parameter
> and be able to call it.
http://www.povray.org/documentation/view/3.7.0/479/
Parse_String(String). This macro takes a string, writes it to a file, and then
includes that file. This has the effect of parsing that string:
"Parse_String("MyColor")" will be seen by POV-Ray as "MyColor".
Parameters:
String = The string to be parsed.
So, the idea is that you pass the macro name as a string parameter, and then
parse that string to turn it into an SDL directive.
If you provide some scene code with some comments describing what you want your
code to do, maybe someone can suggest an alternative method for accomplishing
the same goal.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 13-Dec-21 11:08, Bald Eagle wrote:
>> Unfortunately I have not found a way to pass a macro name as parameter
>> and be able to call it.
> Parse_String(String)
> So, the idea is that you pass the macro name as a string parameter, and then
> parse that string to turn it into an SDL directive.
Fantastic, I'll try that.
> If you provide some scene code with some comments describing what you want your
> code to do, maybe someone can suggest an alternative method for accomplishing
> the same goal.
I'll perform some experiments and gladly publish them.
Thanks!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
hi,
Alessio Sangalli <man### [at] gmailcom> wrote:
> On 13-Dec-21 11:08, Bald Eagle wrote:
> ...
> > Parse_String(String)
> ...
> Fantastic, I'll try that.
fwiw, my recent 'Foreach()' macro too uses that "trick". given that your
project is well underway, you may not find it very useful though :-).
<https://drive.google.com/file/d/11PqhmEP2p1nEOH6jCJC653B08NfHVmOn/view?usp=sharing>
regards, jr.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"jr" <cre### [at] gmailcom> wrote:
> fwiw, my recent 'Foreach()' macro too uses that "trick".
What, did you think you think I came up with all these great ideas on my own?
I steal them from you! :D :P
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 13-Dec-21 13:48, Alessio Sangalli wrote:
> I'll perform some experiments and gladly publish them.
It worked pretty good; a simplified version of what I have done is:
#macro animation_step(step_function, duration)
#declare local_clock = (clock - animation_framework_current_stage)
/ duration;
Parse_String(concat(step_function, "(local_clock)"))
#end
I put in some more work today to improve my animation framework and used
Parse_String() a couple more times.
Thanks
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 12/15/2021 12:57 AM, Alessio Sangalli wrote:
> On 13-Dec-21 13:48, Alessio Sangalli wrote:
>
>> I'll perform some experiments and gladly publish them.
>
> It worked pretty good; a simplified version of what I have done is:
>
> #macro animation_step(step_function, duration)
> #declare local_clock = (clock - animation_framework_current_stage)
> / duration;
> Parse_String(concat(step_function, "(local_clock)"))
> #end
This is brilliant. I wish I'd thought of it years ago.
dik
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |