VFB Stamp with maxscript variables

Hi!

I’m using the Stamp layer in VFB to embed the camera name in my early iterations to customers, and that works fine. However, we are increasingly using the Daylight system to get the correct sun, and it would be really helpful to be able to stamp the Daytime time (date, hours, minutes) as well, reflecting which time of day the scene’s sun is showing at rendertime. Is this possible?

You surely can.

If you run
vfbControl()
it’ll print the help for the function.
under the For Stamps: section, you’ll see there are three options.

So, in your case, once you collected and formatted the data from the sunlight, you’d pass

vfbControl #stamptext "Your Date and Time"

Notice you may need to build the string in a way that it incorporated the other VFB-related variables (f.e. %rendertime).

Thanks! Got the hour min sec up and running, but facing the solar_date now, with offset of days from 21st June. Wow. That was a stupid implementation of the date. Do you know of any solution to get it as a dd/mm/yyyy value? If not, my function will be unusable, as these parameters are as important as the time of day. :expressionless:

Update: I saw this thread (https://forums.chaos.com/forum/v-ray…work-with-vray) which describes how to get a sun working with the new Sun Positioner, where it’s easier to fetch the date parameters. But as I understand I then miss all the new cloud functionality with vraySun, as the model neighter uses vraysun or vraysky. Any direction or tips would be helpful, thanks.

Further update: Tried setting up a vraysun/vraysky model, linking it to a sun positioner. But seems like the sun positioner doesn’t have any sun nodes to link vraysun to, and hence it works as a single object. So this was not a solution :frowning: What about a daytime model in vraysun?

If you toggle the mode for the positioner, it returns the actual point3 for the sun node.
F.e.:


$VRaySun001.target.position = $SunPositioner001.position  
$SunPositioner001.mode = 1 --date, Time, Location
$SunPositioner001.mode = 0 --manual sun positioning
$VRaySun001.position = $SunPositioner001.manual_sun_position
​

This would ofc have to run per frame, i’m afraid, as there is no actual node to link to that i can see.

Interesting. Would maybe work as a pre-render script for bucket rendering, where it syncs the vraysun to the sun in sun positioner, but harder with interactive rendering, I guess (?)

Do you know of any ways to get the position from mode 1?
Like from mode 0 here $VRaySun001.position = $SunPositioner001.manual_sun_position

Unfortunately, that returns [0,0,0].
It looks to me though as if switching modes keeps the settings, so once you collected the position, you should be able to add the line
$SunPositioner001.mode = 1
to get the positioner UI back to its original state.

You can ask AD if they can amend the behaviour though, so that it always passes the sun coordinates.