Displacement in Blender
rscosworth started this discussion in Model Export and Render

Hello) How in Blender i can do some random position/rotation displacement for all parts at same time? In Cinema4d i usually do it with random effector with fracture object with all parts putted in it, and it works good. Is there similar way in Blender? And may be for geometry too, not only pos/rot. Cause we all know that in real life thera are no perfectly aligned bricks ) and usually they are a little bit scratchy and have some deformations (from my boys and dogs tooth for exaple lol))). I want to simulate all this things to make render more realistic.
And btw, question about materials - i want to simlate some roughness in silver parts, hard to explain sry) if you take some silver part, Titanium Zane minifigure for example(or 1*1 silver or gold slope brick) - in closer look u can see that there is some milky displacement in plastic, not too much but it is visible. I tried to simulate it today but finally nothing similar( Closer look makes adding Waves shader but its not what i want, it looks too much unreal) and i'm not sure where is right place in chain of nodes to put some shader like that...or mb is better to find some texture and use it but i cant understand how i must use it properly(

Waiting 4 your answers, guys

19 replies · Page 1 of 1
Avatar of Scrubs
Administrator

Hello,

Not too sure about a simple way to randomize the position/rotation in Blender. I'm sure it could be done with a Python script anyway. I was thinking about adding this option in the export module of Mecabricks. Maybe it will come at some stage.

You can check the Blender template updated by Sunder_59 for random scratches and colour variation randomization. https://yadi.sk/d/YG-wNXFnprTMr
However, when I tried it, it was making the rendering time wayyyyyyyy longer.

Recently, I also tried to add finger prints, dust and scratches using normal/bump maps. I did not spend too much time on that yet so it was only averagely successful but I'm sure something cool could come out of it.

It would be really great to adding an option for randomization of bricks! Also, is it possible to optimize someway exporting so model can be opened in Cinema4D properly? Now it loosing all materials on importing ( and there is no optoin in c4d to smooth knobs and other round corners like Blender does it(with preserve edges) so is it real may be to add smoothing during exporting from mecabricks? or it is impossible because of engine used?

Blender Cycles shaders are not compatible with Cinema 4D or modo shaders and there is no easy way to convert them, so if you decide to primarily work with Cinema 4D (or modo or any other 3d app), you'd have to create your own Lego material library and manually apply those materials. Exporting from MB optimized for C4D would require developing a template similar to the one for Blender including all the Lego materials, a script to automate the process of applying those materials to the imported model, plus some solution for soft edge shading.

Regarding soft edges: during rendering in Blender an OSL-based edge shader is applied (which unfortunately prevents us from doing faster GPU renderings in Blender, because OSL is not supported on GPUs). That means, if you export from MB, round edges won't appear in C4D or any other 3d application, because they are not part of the actual geometry. For C4D there's some 3rd party solution available, though. See http://www.biomekk.com/index.php?itm=18 for details (I believe modo comes with some built-in solution for round edge shading). If you don't want to spend money for the plug-in, you could also build your own edge shader based on a proximal shader. I've already searched for a template, but haven't found something usable yet. Perhaps I will look into this a bit deeper, when I can spare some time.

Avatar of Scrubs
Administrator

I am a bit confused rscosworth. Are you talking about a smooth / flat shading or are you talking about rounded edges like wlange explained?
Did you try to recalculate the normals? They are not part of the exported file.

Yes, good point, Scrubs. Recalculating the normals after importing Collada or OBJ wasn't required during my tests with C4D default import settings, though.

Here is what it looks like when imported in c4d - http://s017.radikal.ru/i407/1603/41/7f27ae8e85c6.jpg
U can see all those edges on round faces and all parts are polygon objects. Also u see that materials are present in project but not applied on any part( and this is main problem. I can solve it by importing model in Blender first and export again after applying template script, but those edges on round parts will still present in model

Avatar of Scrubs
Administrator

It actually looks what it is supposed to look... Parts are not high resolution and when you zoom in, it is what you get.
For the materials I am not too sure as I don't have access to C4D. It works in all the other software people tried (Blender, Modo, Sketchup, ...)

But all that parts looks perfect in Blender on render (

Avatar of Scrubs
Administrator

Because they are not close up. From a distance it looks fine but very close, circles start to not really look like circles 😉

LOL, so it was the 3rd possibility regarding what edges we were talking about here...

@Scrubs, MB-exported .dae files open basically fine in C4D, but the materials (except for decal textures) won't be applied to the individual polygon objects of the model, although the MB default materials are actually importing (as you can see on rscosworth's screen shot). Hard to say, what's causing this, but it might be an issue with the C4D Collada importer - at least in Sketchup materials are applied as expected. Imported materials need to be replaced anyhow, but it would of course be less painful, if they then wouldn't have to be applied manually to all objects of a model. A nightmare, if this has to be done with larger models. Solving this problem would be an important first step as to the development of a C4D template.

I will do some more testing to find a halfway workable pipeline/workflow to C4D. For me, it would still be interesting to get MB models into C4D, as this would open up a whole new world of possibilities with regard to animation and post-processing (Mograph and Cineware, to name just two). I'm still not convinced that I really want to stick with Blender, although I love its nodes approach for shaders and compositing (I read recently, that modo includes some similar feature).

@Srubs, a simple model created in Sketchup with only basic color materials applied and then exported to Collada already doesn't import properly into C4D, i.e. used materials are visible, but objects don't have the respective material tags applied (same as MB Collada file import). So it looks like the C4D Collada import filter is not working very well.

@rscosworth, for now, it seems that the best way to get a MB model into C4D is to export it to OBJ first. All materials appear as grey in C4D, but all objects have the proper material tag applied, so getting them right is a matter of editing these (in most cases that should be only a few). You can use the script available under https://github.com/mredig/Parse-MTL-C4D to apply colors and textures as defined in the .mtl file exported by MB. Afterwards, switch off the Luminance and Transparency channels for each (opaque) material and fix the paths for any textures not appearing. This is a starting point, but further editing the materials will still be mandatory. There is no complete and ready-to-use Lego material library available for C4D I'd know of, but creating basic shaders and deriving the various color versions from that shouldn't be too difficult.

here u can compare smoothness in blender and c4d:

c4d , look at highlighted places (
http://s017.radikal.ru/i404/1603/90/57719271cb14.jpg

Blender:
http://s011.radikal.ru/i317/1603/f7/0b7e0fdf149d.jpg

Avatar of Scrubs
Administrator

Yes, you are actually right. It is visible on your image. I have no ideas...

rscosworth, try to apply a phong tag to your objects. Otherwise, if you upload your model somewhere, I could take a look what the issue is.

phong tag applied by default. You can export any simple objects from MB and see it

I don't see such issue with my models exported from MB and I doubt that it's a MB problem.

I found that the default phong tag settings after importing Collada or OBJ files to C4D are not good (not a MB issue). The Phong Angle should be set to 30° and the Use Edge Brake option should be checked - otherwise rendering results won't be satisfactory.

Woooh it works!

I'm glad, we could help.

Advertising
3 participants
Avatar of rscosworth
Avatar of wlange
Avatar of Scrubs

LEGO, the LEGO logo, the Minifigure, and the Brick and Knob configurations are trademarks of the LEGO Group of Companies. ©2024 The LEGO Group.

Mecabricks, the Mecabricks logo and all content not covered by The LEGO Group's copyright is, unless otherwise stated, ©2011-2024 Mecabricks.