Message 1 of 2
Export LightNode Information
Not applicable
08-22-2019
03:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All.
I am trying to export LightNode information so I can use it in a custom application.
Right Now I have prototyped this:
public void OnLight(LightNode node)
{
#if _2018
var lpcd = node.GetAsset()["lightProfileCacheData"] as AssetPropertyString;
#else
var lpcd = node.GetAsset().FindByName("lightProfileCacheData") as AssetPropertyString;
#endif
Transform lightTrf = node.GetTransform();
LightOptions newLight = new LightOptions();
newLight.name = node.NodeName;
newLight.pos = lightTrf.Origin;
newLight.angle = lightTrf.BasisX;
if (lpcd != null)
{
byte[] data = Encoding.Unicode.GetBytes(lpcd.Value);
newLight.path = System.Text.Encoding.UTF8.GetString(data);
}
if (!lights.Contains(newLight)) lights.Add(newLight);
}
//LightOption Class
public class LightOptions
{
public XYZ pos;
public XYZ angle;
public string name;
public string path;
public string iesName;
}However, I am trying to get the light direction, spotlight angle and some of the other metadata attached to a lightNode. Unfortunately the documentation does not lead me anywhere.
Any ideas?