jdmac
0
I want a script that will get the DateTime from a Skylight object and update the text of a Text Spline Object.
I haven't written a script for C3D before, so I'm hoping to get some pointers here.
One basic question is what kind of script should I specify? I've started with Tag script.
Below is what I have so far based on looking at some other scripts; but script doesn't show any visible changes.
(Of course, if the text value of the Text Spline Object can be dynamically set, than script could be modified to get parameters from any object, I suppose)
I haven't written a script for C3D before, so I'm hoping to get some pointers here.
One basic question is what kind of script should I specify? I've started with Tag script.
Below is what I have so far based on looking at some other scripts; but script doesn't show any visible changes.
(Of course, if the text value of the Text Spline Object can be dynamically set, than script could be modified to get parameters from any object, I suppose)
JavaScript:
/*
* Time of Day.js
*
* Created by Jerry McCreary at 10/28/19
*/
function buildUI( tag ) {
tag.addParameterLink("Skylight", true);
}
function applyParameters(tag){
var owner=tag.owner();
var doc=tag.document();
var sun=tag.getParameter("Skylight");
var txt = sun.getParameter('Date');
owner.setParameter("Text",txt.toString(),false);
}