Export LightNode Information

Export LightNode Information

Anonymous
Not applicable
472 Views
1 Reply
Message 1 of 2

Export LightNode Information

Anonymous
Not applicable

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?

473 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

I need to convert these XYZ's to Vector3's in Unity3D so all conversion is to Unity's default 1m:1Unit

 

 

 

0 Likes