Material Conversion Tips/Shortcuts


#1

I have a scene with ~160 different materials that I’m converting from Render Engine A to Render Engine B (the engines themselves don’t matter much, so I’m not mentioning either to keep things clean on here).

The materials themselves are mostly quite simple - color & specular, a few with texture files. However, it’s the process of creating a new material, copying the basic values over, selecting all the material tags, and drag/dropping the new material into those slots that’s time consuming.

There’s no auto-material-conversion tools available for engine B, so that’s not effective.

In general, I’m just looking for some basic C4D tips/tricks to help speed up the process. Currently I’ve found the “Select Texture Tags/Objects” Command to be very helpful, and didn’t know if there were any other hidden gems to be found.

Thanks!
Luke


#2

My go to has alwasy been the select texture tag objects, but there is also the Texture manager under the materials texture menu. Theres a repl;ace function within that.


#3

The “Replace Textures With” command in the texture manager is unfortunately only for replacing actual bitmap files instead of. the material as a whole. It’d be great if the Material Manager functionality was expanded to make this process speedier, as with the increase of render engines comes the necessity for people to convert more materials.

Even a command/script that does the following would be helpful:

  • For each Material X selected, create material Y
  • Copy the name of material X and paste it into material Y
  • Replace all instances of material X with Material Y

Perhaps a material exchange “hub” could be created, with each render engine creating a script that could exchange materials between their native format and a neutral format (perhaps MaterialX - Open source, used/developed by ILM). This would allow everyone to relatively easily convert lots of materials regardless of what the render engines in question are.


#4

For this step, in the material manager, you can select the new converted material and hold the ALT (Option) key and drag it onto the material you want to replace. This globally replaces the old material throughout your entire scene. It won’t mess up any setting s in your individual texture tags

I do this a lot when converting older scenes to a new render engine :slight_smile:


#5

Ahh, that’s schnazzy. Thanks for the tip!


#6

How about if you were to replace material on only some objects, which use a material, that is also used among other non-selected objects?

I can drag and drop a new material onto selected objects, but that leaves me with the old material still being there. Is it possible to replace the old one, on only the selected objects?


#7

Go to the old material.

In the Attribute Manager, open the Assign tab.

For all objects where you want to replace the material, strg-click the object to select. Leave the objects alone that you dont want to change.

Now right-click over the texture tag icon (NOT the name of the object, NOT the geometry icon!). You get a menu that contains a Select Tag option. Use that to select all the tags with this material that you wish to change.

Now you can just use the attribute manager to drag the new material into the Material reference slot of the tags. As you have a multi-selection, all tags will be changed.


#8

Thanks, it worked and I took it a step further,by selecting several objects, that use different materials. This didn’t work. Since the objects get highlighted in the Objects panel, I manually selected the texture tag for each object there and could then replace them.

Let me ask this way: How is such a thing normally done? What I did wasn’t straight forward or intuitive and in a complex scene, I’d have to make sure I got all tags selected. Just selecting the objects and dropping the new material in the viewport was very straight forward - except, the old material was left behind. Is that even a problem? Other than if I did that 10 times, I’d have 10 material tags.


#9

The issue here is: Objects can have more than one texture tag, even of the same material - it is even possible that an object has two texture tags with the same material on different polygon selections, so it’s a normal case and not just bad assignment. Your desired replacement is therefore ambiguous since you don’t want to select a concrete material nor a concrete set of tags which would resolve cases where there is more than one possible solution.

That raises the question: what will the proposed functionality do if it hits such an ambiguity in any of the selected objects? It’s easy to handle objects that have only a single texture tag anyway, but if there are several:

  • Ignore objects with more than one texture tag; handle only the unambiguous cases
  • Report objects with more than one texture tag in the console or in a popup window
  • Consider only tags with no selection (this may still be ambiguous)
  • Consider only the rightmost tag with no selection
  • Brutally replace all tags

Once you know what you actually need to do in a certain situation, you can write a script that does it in precisely the way you want it done. I suppose the internal functionality concentrates on usecases that are unambiguous from the start.


#10

Oh, and then there is the case with selected objects that do not have a texture tag at all. Add one? Ignore it?


#11

this all sounds a bit overly complicated to me. whenever i have a case like this i tend to just copy the name of the material, create a new material, paste the name, define the materials attributes, and then alt-drag the new mat onto the old one. it then just replaces the material itself, so every tag in the scene referencing the old material will now use the new one. no need to select tags at all. if i need to keep the old materials for reference i just copy all of them first and put those copies in their own material tab, so they don’t clutter the interface. maybe i’m missing something here, but selecting all the tags used by material xy and then somehow replacing those tags sounds just cumbersome and doesn’t provide any benefit over the method described above.


#12

that is all nice and easy and works with the built-in functionality, but Zafar explicitly asked for a function that would:

  1. allow him to make the selection by object, not by tag
  2. allow him to replace arbitrary tags regardless of the material.

Thus, you run into ambiguities.

You are probably right though regarding the need (or lack of) for such a function, I haven’t encountered this usecase either so far.