I am using matlab for a university project to create a simulation of an aerial package drop using 3d models that I made in Blender. I am exporting from blender in ~.stl format (binary form) and importing the file using a matlab script to use in a 3d graph.
Now comes the part I need help with. Rhe script I'm using in matlab can also extract colour data (if any) from the file and apply it to the model. However, a standard stl file only contains info on vertices and faces, but I know from a little research that it is pssible to create ~.stl files with colour data included.
While I could either artificially create the colour data in matlab or just give each model one colour, I'd like to be able to just import the data from blender. Therefore, I've come up with a couple of ideas and was wondering if anyone knows the method/related scripts to achieving one of these solutions? They are:
export model in a different file type that contains colour, to do this I would (probably) need a different matlab import script relating specifically to that file type;
find the correct settings or find a python script that allows blender to attach colour data to an exported ~.stl file; and,
export each different coloured part of each model as it's own model and relate their position to each other in matlab. this I know how to do, but it's tedius and would slow down the simulation unnecessarily.
Also, two other quick things. I'm currently creating the models using cycles engine, in terms of exporting (colour) model data would it be easier to switch to blender render? Also, out of curiosity, to what extent can the material effect from blender be exported? Obviously diffuse can be exported cause it's just applying model colour, but what about effects like gloss, transparency, reflections, etc?
Thank you for your time.