[solved] how apply material for object? is it working?

A forum to discuss the implementation of a good Materials system in FreeCAD
Post Reply
User avatar
dprojects
Posts: 561
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

[solved] how apply material for object? is it working?

Post by dprojects »

Hi, I am trying to apply Wood Material for object Cube or Pad without success. Later, I would like to use Arch Texture workbench to rotate example grain direction texture (.png transparent file with grain direction mark) on face object and see how it impacts the XML object structure. I would like to know if this could be used this way for woodworking purposes or this need to be improved.

But when I selected Pad or Cube object and click material creation like it is described here https://wiki.freecadweb.org/Arch_SetMaterial but I got error:

Code: Select all

23:04:28  <Exception> type must be str or unicode, not FeaturePython
23:04:28  Running the Python command 'Arch_Material' failed:
Traceback (most recent call last):
  File "/tmp/.mount_FreeCAGq1Ybw/usr/Mod/Arch/ArchMaterial.py", line 128, in Activated
    FreeCADGui.doCommand("FreeCAD.ActiveDocument.getObject(\""+obj.Name+"\").Material = mat")
  File "<string>", line 1, in <module>

type must be str or unicode, not FeaturePython
I can create Wood Material without selection but I am not able to apply it to the object.
I am doing something wrong? or this is not implemented to the end? or lost feature?

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
dprojects
Posts: 561
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: [solved] how apply material for object? is it working?

Post by dprojects »

OK. I was able to add Material and also MultiMaterial with 2 layers (one Wood and one Grain).
There need to be added new property to the object named "Material" and the type App::PropertyLink. Looks like bug or forgotten and not further developed good functionality.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
OlPhil
Posts: 7
Joined: Fri Aug 12, 2022 5:32 pm

Re: [solved] how apply material for object? is it working?

Post by OlPhil »

I tried to use Arch Textures today on my Mac with FC 0.20 and it seems not to be working at all anymore. Even when I insert a "Material" branch into the Databranch of the object with App:ObjectLink it doesn't work.

Does someone know if Arch Textures will be updated or if there is some work on a FreeCAD solution for applying Textures to an object?

Greetings,

Phil
User avatar
dprojects
Posts: 561
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: [solved] how apply material for object? is it working?

Post by dprojects »

OlPhil wrote: Fri Aug 12, 2022 6:16 pm I tried to use Arch Textures today on my Mac with FC 0.20 and it seems not to be working at all anymore. Even when I insert a "Material" branch into the Databranch of the object with App:ObjectLink it doesn't work.

Does someone know if Arch Textures will be updated or if there is some work on a FreeCAD solution for applying Textures to an object?

Greetings,

Phil
Hi, Phil, I don't know about Arch Textures workbench but you may want to try setTextures macro. It allows to add URL to the texture from the internet and also there is added option to store local hard drive path.

Material Card is little different thing than texture, it is more about object technical description. However, the Material Card has link to texture and the setTextures can read the texture from there as well and apply the texture if the Material Card is assigned to the object.

There is also rendering workbench as far as I know, maybe there are some more options for textures.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
Post Reply