- Home /
send csv colour values to multiple meshes
I have a large csv file that i generated through python in cinema4d. It saves the colour for each mesh (182 in total) over the course of 90 frames at 30fps, i was wondering how i would go about applying this data to the imported meshes to be able to visualise it?
Answer by potatoqueue · Jan 23, 2017 at 08:18 AM
okay so been doing unity for a day now :s i've managed to get all the mesh objects with a tag into an array:
using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Linq;
public class iteratebabies : MonoBehaviour { public GameObject[] meshestocolour; //create public array which stores meshes
// Use this for initialization
void Start ()
{
meshestocolour = GameObject.FindGameObjectsWithTag("meshtocolor").OrderBy(g=>g.transform.GetSiblingIndex()).ToArray(); //return objects in scene with specified tag in this case meshtocolor
//assign all objects in scene tagged meshtocolor and holds them within the array meshestocolour
//returns in the correct order
for(int i = 0 ; i < meshestocolour.Length; i++)
{
// reversed
Debug.Log("Mesh number " + i + " is named " + meshestocolour[i].name);
}
}
}
I now want to split the csv file which comes into excel in 1 cell, and split it after every 181 commas and set these values per mesh in the array meshestocolour
Your answer
![](https://koobas.hobune.stream/wayback/20220612105305im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Removing rgb channels from material animation turns color black 1 Answer
iTween: How to animate other shader-color values besides the main Color? 1 Answer
What is the best way to implement the ability to allow multiple colors on a duplicated mesh? 1 Answer
Why colors are being mixed after I try to change them? 1 Answer