Jump to content
You are about to reply to a thread that has been inactive for 4224 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Posted

I got a bit of a problem when I try to make different LODs in Cinema 4D. Whenever I make a new LOD and then export it, which material goes where is just scattershot across the object. It's not a real problem when having only two faces. Then I can just export it a couple of times more and each time it is a 50% chance I get it right. But for hightly detailed scenes where you have a whole bunch of things in the same texture, or when you just want many texture faces for the sake of animation or customization, the probability gets much, much lower. In the example included, I got 4 materials. It is exported from the same document with just the polygons reduced and optimized.

To get something like this right by exporting over and over and get it right is something like 6%.

LOD-SL-C4D.jpg
Another method I've found is to manually edit the .dae file in a text editor and edit the material tags. That however takes a lot of time, especially if you're making a set of 10 pre-fabs and make 4 LOD for each, that's 30 files to manually edit.

Do anyone know how to fix this? Or if there is a Collada file editor in which you can manually change the texture faces without having to use a text editor? Or perhaps an unofficial Collada exporter which does a better job?

Posted

Not knowing C4D, I can't offer anything specific. This does seem odd. As far as I know, the last time I looked into it, the only thing that determines which material goes on which face is the "xxx" name in the material="xxxx" attribute in the <polylist> (or <triangles>) tag that defines the face. The different LODs have to have the same number and set of material names, or the upload is rejected with an error. So if your files upload, they must be using the same set of material names, but in the wrong order. Can you tell where the exporter gets the names from? If so, can you verify that they are correctly associated with the faces in C4D? If they are, then the exporter must be messing them up.

Posted

The materials keep their names in a sense, however in the material binder they get renamed. And the IDs get randomized. For instance. In the "Low" example file I got, for one of the cubes:
Material="Material1"
If we go to "Material1"
Target=#ID9
If we go to #ID9 (which is a material in the material list)
name="Mat.2"
Instance_effect url="ID10"
Mat.2 is the name it had in Cinema 4D, so it maintains the name. In the effect, ID10 I got all the textures and colours etc.

So I need to backtrack 4 steps to find out which object got which material. Meanwhile the materials are always named Material1 to Material7 (or higher if you use more faces than SL can handle for that matter). Each time I export the object, the IDs get randomized. Sometimes they stay the same, and doesn't get randomized until I change the texture areas about. So meanwhile an object of lower LOD might look all screwed up in C4D, the actual LOD in SL looks okay. And there is no real system to it either. I can remove a material and re-add it to the same place, and everything will still be in completely different places. What I can do (and what I'm doing) is back-tracking all materials to the source and then replace them in the .dae file. I found it to be easiest to change it already in the polylist-tag. But it just takes so much time!


So, yes, the exporter is messing it up. I read somewhere that Maxon made it like that since they had problems with people using special characters, which tended to screw things up down the line for other applications. They fixed this by renaming the materials automatically. Which in turn screws it up for us people who make LODs. I'm just hoping someone found a good workaround or a simpler way to re-assign the material faces. =/

Posted

Yes. The triple indirection makes it look complicated. However, the important thing is that it is ONLY the first step, material attribute that matters. The uploader does not follow the remainder of the links when associating actual effects (texture etc.) with faces for the lower LODs. You can juggle as much as you like with the other links, or even delete them from the lower LODs*. Just make sure the equivalent faces/polylists have the same material attribute at the lower LODs as the high LOD, and all will be well.

* To do that, you delete the entire <library_images>, <library_effects> and <library_materials>, and delete the <bind_material> section from the <instance_geometry> in the <visual_scene>. If you delete these from the high LOD, you will still get a mesh with the right faces, but of course they will have no textures (or colours if you omit textures).

Posted

That is what I am currently doing. However the only way to figure out which material goes where is to trace it back all the steps. If there are only 2 materials it is easy to just switch them around, then we can only have 2 combinations. But since I don't know which face is which and which material is which without backtracking, I end up having to take the long way around for models with more faces. Say I got 4 faces, then we got 16 different combinations. It's the detective work I'm trying to get around.

The dream would be to be able to re-assign material faces directly in the uploader. But I doubt that'd ever get implemented, and I know too little about programming to attempt making such a thing myself. Or, well, the real dream would be a working plugin for C4D so I don't get the problem to begin with.

Posted

It's the order (if I am understanding correctly).

I name my materials and objects with a coded name and numbering system then edit the .dae sorting externally then pasting back in.

Not pretty - but I think it's a known "feature" of C4d with Collada unf.

I am also hopeful somebody else comes along with a workaround as it's pretty annoyng.

You are about to reply to a thread that has been inactive for 4224 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...