Texturing Architectural Objects

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

Re: Texturing Architectural Objects

Post by regis »

furti wrote: Fri Oct 19, 2018 10:18 am Hello :)

I created a Workbench that can be used to texture architectural objects https://forum.freecadweb.org/viewtopic.php?f=9&t=31598.

As @paullee suggested I cross post it here. Hopefully this is OK. Otherwise feel free to remove this topic :)

If you have some feature requests or improvements regarding arch and textures we can discuss it here.
@furti, I'm terribly impressed by this development you are doing on freecad aswell. Thanks a bunch to your contribution. You've made freecad even more attractive to new comers by introducing this texture thing. Muchos muchos muchos gratias.
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Re: Texturing Architectural Objects

Post by furti »

@regis Thanks a lot for your kind words.

I like FreeCAD a lot and I'm gratefull for this awesome piece of software. So when I want to give back to FreeCAD as much as I can :)
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Texturing Architectural Objects

Post by paullee »

Hi, just notice in another thread that there is addon and ongoing effect to directly import FC file into blender.

Would be exciting if all the texture / UV mapping did can be shared between two software and need not repeated! :D

Discussion below:
https://forum.freecadweb.org/viewtopic. ... 3#p271516
peterd wrote: Fri Nov 30, 2018 9:29 pm
It is now possible to import a FreeCAD file into Blender directly with an add-in if you use Blender with python 3 in it:
https://gist.github.com/yorikvanhavre/e ... 95c429ba87
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Texturing Architectural Objects

Post by vocx »

paullee wrote: Sat Dec 01, 2018 8:14 am Hi, just notice in another thread that there is addon and ongoing effect to directly import FC file into blender.

Would be exciting if all the texture / UV mapping did can be shared between two software and need not repeated! :D

Discussion below:
https://forum.freecadweb.org/viewtopic. ... 53#p271516
...
I just want to repeat myself a little from that other thread, as I prefer to keep the discussion in this Arch subforum.
vocx wrote: Mon Apr 01, 2019 6:21 am I just wanted to mention that Blender materials are a bit more complex than what FreeCAD considers a "material". Blender needs to know type of shader (glossy, diffuse, emmissive, anisotropic, etc.), and then particular values of properties like roughness, specularity, metalness, and other details like normal maps and textures that help Blender render the material with correct illumination and shadows to produce a photorealistic result; I think this is outside the scope of FreeCAD. What FreeCAD can export as a "material" is basically only the color (diffuse color) and its transparency (alpha).
Basically, Blender cares about the physical appearance of the material, while FreeCAD doesn't care too much about it. This makes sense as Blender and FreeCAD have different philosophies. Blender cares about the visual representation of objects (shadows, lighting, texture), while FreeCAD cares about creating those objects. Designing an object requires knowing its precise dimensions more than anything, not so much its final color or texture.

However, I think it's completely possible for FreeCAD to extend its material system to also include some information on the roughness and visual appearance of the material. Although these properties wouldn't be used in FEM or Arch or other FreeCAD workbenches, they could be exported to Blender to create basic material nodes for their renderers EEVEE and Cycles.

Regarding the Blender plugin to import FreeCAD files. It is developed by Yorik himself, so he probably has a good idea of what makes sense in an Arch -> Blender -> Render workflow.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
dpettegrew
Posts: 44
Joined: Sat Feb 09, 2019 8:20 pm

Re: Texturing Architectural Objects

Post by dpettegrew »

vocx wrote: Mon Apr 01, 2019 6:50 am
However, I think it's completely possible for FreeCAD to extend its material system to also include some information on the roughness and visual appearance of the material. Although these properties wouldn't be used in FEM or Arch or other FreeCAD workbenches, they could be exported to Blender to create basic material nodes for their renderers EEVEE and Cycles.
I am not a developer and am still pretty novice in both FreeCAD and Blender but I have been thinking about this workflow for the future as I am learning both so I thought I would add my two cents here in case it is useful. I don't imagine I would need much in the way of roughness information within FreeCAD but I have been thinking that it could be useful if FreeCAD materials automatically generated materials slots in Blender and maybe just defaulted to a base color diffuse. If Blender at least recognized that there were multiple materials it seems to me then it would be relatively painless if you need to make adjustments to the FreeCAD model for render again in Blender..

Thanks to all the developers.
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Re: Texturing Architectural Objects

Post by furti »

I think it shouldn't be too hard to add materials tothe blender plugin. I would go for the principled shader intoduced with blender 2.79 as this is a pretty easy to use and powerful shader :)
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Texturing Architectural Objects

Post by vocx »

dpettegrew wrote: Mon Apr 01, 2019 12:12 pm ... it could be useful if FreeCAD materials automatically generated materials slots in Blender and maybe just defaulted to a base color diffuse. If Blender at least recognized that there were multiple materials ...
This already exists. Take a FreeCAD model; change the color of the shapes as you wish; export the file to Wavefront OBJ; import this file in Blender. Each object with a different color gets assigned its own material in Blender ("color_bb43aa", and the like), which is just a "diffuse shader" with a particular "color mix" node. Many other material nodes are sometimes created, but you can delete those and only keep the diffuse shader to start.

Have you tried the plugin? It seems it already does this from within Blender, without needing to export the OBJ file from FreeCAD as an intermediate step.

https://gist.github.com/yorikvanhavre/e ... 95c429ba87

Code: Select all

                            diffshader = bmat.node_tree.nodes.get("Diffuse BSDF")
                            if diffshader:
                                diffshader.inputs['Color'].default_value = rgba
# TODO add Cycles node to handle transparency
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Texturing Architectural Objects

Post by paullee »

Yes, though it seem Blender's materials may not be identical to what FC needs... it may be desirable if there is some shared properties...

Furti's workbench make FC start to work like sketchup, with some basic 'Texture Map'.

If FC support shadow, it would be another big improvement especially for Arch / Interior uses.
dpettegrew
Posts: 44
Joined: Sat Feb 09, 2019 8:20 pm

Re: Texturing Architectural Objects

Post by dpettegrew »

vocx wrote: Mon Apr 01, 2019 4:59 pm
Have you tried the plugin? It seems it already does this from within Blender, without needing to export the OBJ file from FreeCAD as an intermediate step.
Hi thanks, no I have not got around to trying it yet.. too many projects on hand at the moment trying to balance the learning curves of both FreeCAD and Blender with use within realworld projects. Happy to hear that feature works essentially as I'd expect it to. That will make it easier when I am ready to tackle that next step in learning this new workflow. Sorry adding bloat to the forum ;)
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Texturing Architectural Objects

Post by vocx »

furti wrote: Mon Apr 01, 2019 4:24 pm I think it shouldn't be too hard to add materials tothe blender plugin. I would go for the principled shader intoduced with blender 2.79 as this is a pretty easy to use and powerful shader :)
It's already there. Yorik updated the plugin two months ago.

https://gist.github.com/yorikvanhavre/6 ... -2-80-L381

Code: Select all

                        if not bmat:
                            bmat = bpy.data.materials.new(name=obj.Name)
                            bmat.use_nodes = True
                            principled = PrincipledBSDFWrapper(bmat, is_readonly=False)
                            principled.base_color = rgb
                            if alpha < 1.0:
                                bmat.diffuse_color = rgba
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply