I have 4000 FBX format elements exported from Catia V5 or V6. Each element has a unique ID, 3D cooridnates and material properties.
I also have an “dynamic” Excel sheet with ID and time properties associates to each element, cause the time will change once a week.
My task is to
put all elements in one Rhino model based on their coordinates.
change elements’ material color according to color changes based on the predefined rules.
outout the whole model as FBX.
I plan to get material name using Excel formula and output the then names to GH.
I want to know which GH components I should use to change the material colors.
In this example, I want to assign “Concrete Purple”, “Concrete Green” and “Concrete Blue” to the 3rd, 4th and 5th object (from left to right), respectively in Grasshopper.
Result should be:
in order to control the visualization color of gh objects you can use the custom material component, under the display tab.
if you want you can fully control the color directly in GH using RGB, CMYK and HSV.
You can convert any data in number and use it as color.
to read the excel take a look at lunchbox on food4rhino.
I couldn’t find “custom material component”, but I found “Creat Material” under GH->Display-> preview.
But it will generates material, how do I apply material to objects?
I’m sorry, I’m answering from the phone, so I don’t remember the right name of the component.
should be next to “create material”
Anyway, it’s kind of opposite behavior.
the object where displayed with specific material.
so
the geometry goes into the create material
You can extract color or object information from any object and use this information to apply properties during bake. If you want a concrete color in there you would have to do some data matching, search the objects say you want concrete texture applied to, and then assign a bitmap texture to that specific branch during material creation. If you want the same texture to all materials then just give a file path in a flattened branch.
In the example i show, if you have multiple objects with the same color, you will get a material for that color only without doubling up.And the naming convention for mats will be just numerical…
Without doing this for you the level of difficulty will be intermediate, tell if you get stuck, i am sure someone may do the task for you…
but you will need at least in the def i have shown the plugins elefront - to get attributes and tree8 to create tree structure…
The example 3dm contains the materials they want to assign. The Custom Preview component is the easiest to do so with the existing document materials.
I suggest adding a Custom Preview component for each color, then have logic that sorts the 4k objects such that each set connects to the correct preview component.
The logic is the rules by which decision of material is made, of course.
the tricky bit will be sorting the data, anyhow. i can propose a method if the data embedded within the fbx geo as rgb layer color or other as this would make it easier than using excel sheets?
The color (or materials) will change according to other parameters which is stored in an Excel sheet.
It might be better to get the color (or the material name) in Excel based on those parameters then exportto GH to change objects color(material).
As for sorting the data, this is the excel example:
ID is the unique name assigned to each FBX object. P1-P3 is the parameters that change every week. Color values are determined from these parameters.
In grasshopper, the ID is not sorted in order (A1, A2, A3, A4, A5), instead it is sorted as below: