0
$\begingroup$

For each object of the scene (there are a lot of them) I use a single material.

Object index based color

I need to use the Python script to read the current value of the Color output of the Color Ramp node and write it into a text file for each object in the scene.

Please advise how to do this. Thank you very much in advance.

$\endgroup$
  • $\begingroup$ While getting the info 'generically' of the nodes and outputting that to a file isn't an issue I believe your specific request will run into the same issue as mentioned here. "The object info values are only applied once the scene gets rendered." $\endgroup$ – Ratt Dec 16 '18 at 12:48
  • $\begingroup$ Ratt, thank you. I read your question. If reading information from a node is not a problem, can you tell me how to do this or where to read about it? In general, I want to run a python script once to generate a legend — a matching between the object name in the scene and its identifier from the Object info node (random). $\endgroup$ – Serge V.F. Dec 16 '18 at 14:07
  • $\begingroup$ By the way. Maybe someone knows how a random Object identifier is generated in Blender? Then this procedure could be repeated in its own Python script. $\endgroup$ – Serge V.F. Dec 16 '18 at 14:11
  • $\begingroup$ Serge, the issue is that since the random value from object info won't be generated when running the script every object in the scene will report the same value. As such every object would be reported to have the same color from the color ramp node. $\endgroup$ – Ratt Dec 16 '18 at 14:16
  • $\begingroup$ Thank you, Ratt! So I need to assign a known object identifier myself. But I would not really like to generate individual material for each object (and there may be several thousand of them). Interestingly, and the Object color, displayed in the Display group property, can not be used in the Cycles material? Or maybe Custom properties of the object could be used for this? $\endgroup$ – Serge V.F. Dec 17 '18 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.