Arch Texture Addon: Help Requests

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Arch Texture Addon: Help Requests

Post by furti »

If you have questions or problems with the Arch Texture Workbench please do not post to the Announcements Topic anymore but instead Reply to this Topic. So everything is in the appropriate Forum. :)

New features are still announced in this topic: https://forum.freecadweb.org/viewtopic. ... a666fc1c40
danreb
Posts: 57
Joined: Wed Mar 14, 2018 7:27 pm

Re: Arch Texture Addon: Help Requests

Post by danreb »

Hi Furti,

many thanks for your addon.

I've got a problem resolving textures but I can't realy pick the Freecad release when it first started. Anyway I am working with your latest add-on release and this freecad environnment:
OS: macOS 10.14
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17681 (Git)
Build type: Release
Branch: master
Hash: e94af7ff5e873f263cac51d7d47df68eca183250
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)

context
openging a project with some texture configured
erro in the Freecad report view and project file is open but textures aren't resolved

error msg
Traceback (most recent call last):
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/texture_config.py", line 272, in onChanged
self.textureConfig.execute(self.Object)
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/texture_config.py", line 225, in execute
self.textureManager.textureObjects()
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/texture_manager.py", line 106, in textureObjects
brep = faceset_utils.findBrepFaceset(shadedNode)
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/arch_texture_utils/faceset_utils.py", line 433, in findBrepFaceset
children = node.getChildren()
<class 'AttributeError'>: 'NoneType' object has no attribute 'getChildren'

error comment

It looks like the shadedNode object isn't resolved in the texture_manager.py file (line 104) and

Code: Select all

                    shadedNode = faceset_utils.findShadedNode(switch)
and a "None" object is then used as parameter without subsequent test on parameter "nullity" before asling for it's supposed attributes

Code: Select all

                    brep = faceset_utils.findBrepFaceset(shadedNode)
faceset_utils.py (line 416)

Code: Select all

def findShadedNode(node):
    [color=#FF0000]children = node.getChildren()[/color]

    if children is None or children.getLength() == 0:
        return None

    for child in children:
        if child.getTypeId().getName() == 'SoBrepFaceSet':
            return node

        shadedNode = findShadedNode(child)

        if shadedNode is not None:
            return shadedNode

error details

when I then hit the space button on the textureConfig files all seams to work ok.
N.B.:
  • I've got 2 texture config "textureTuileConcassees" and "textureBardageVertical". The error is hitten on the resolution of the first texture.
  • I've added a print comment before the error line in the
    faceset_utils.py file e.g. "----- node :...."
stack trace when opening the freecad file
Removing Textures
Removing Textures
Texturing objects
Texturing textureTuileConcassees
----- node : None
Traceback (most recent call last):
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/texture_config.py", line 272, in onChanged
self.textureConfig.execute(self.Object)
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/texture_config.py", line 225, in execute
self.textureManager.textureObjects()
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/texture_manager.py", line 106, in textureObjects
brep = faceset_utils.findBrepFaceset(shadedNode)
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/arch_texture_utils/faceset_utils.py", line 433, in findBrepFaceset
children = node.getChildren()
<class 'AttributeError'>: 'NoneType' object has no attribute 'getChildren'

and here the trace when hitting the space key
Texturing objects
Texturing textureTuileConcassees
----- node : <pivy.coin.SoSeparator; proxy of <Swig Object of type 'SoSeparator *' at 0x15b118960> >
Texturing textureBardageVertical
----- node : <pivy.coin.SoSeparator; proxy of <Swig Object of type 'SoSeparator *' at 0x15b118de0> >


Are we always supposed to find "shadedNode" object ?

Thanks for your help.
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Re: Arch Texture Addon: Help Requests

Post by furti »

Thanks for pointing this out. I think the problem only occurs, when you open a document where a TextureConfig is visible. Then it could happen, that the TextureConfig is executed before all view objects are set up correctly.

I added a fix for this. Now when no shaded node is found the object is not textured and a message, containing the object Label, is logged to the Report View. So one can easily see when a object is skipped because of a missing ShadedNode.

I don't know if there are Objects that have no ShadedNode. But it is possible that Nodes with other types of FaceSets will not be texturable with the current implementation.
danreb
Posts: 57
Joined: Wed Mar 14, 2018 7:27 pm

Re: Arch Texture Addon: Help Requests

Post by danreb »

Hi Furti,
thanks a lot. I downloaded your last commit and it's fixed.

Cheers
danreb
Posts: 57
Joined: Wed Mar 14, 2018 7:27 pm

Re: Arch Texture Addon: Help Requests

Post by danreb »

Hi furti,
sorry to botter again but I am facing with a problem on my freecad project files since the last FreeCAD comit (Version: 0.19.17798 (Git)) cf.https://forum.freecadweb.org/viewtopic. ... 11#p328211

Since this commit (but it was OK in earlier FreeCAD version) I am not able to resolve my ArcTextures anymore.

error
when trying to resolve te TextureConfig files I've got the following error
Traceback (most recent call last):
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/texture_config.py", line 272, in onChanged
self.textureConfig.execute(self.Object)
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/texture_config.py", line 225, in execute
self.textureManager.textureObjects()
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/texture_manager.py", line 96, in textureObjects
texture, bumpMap, textureConfig = self.getTextureForMaterial(o.Material)
File "/Users/bblockmans/Library/Preferences/FreeCAD/Mod/ArchTextures/texture_manager.py", line 205, in getTextureForMaterial
materialName = material.Name
<class 'AttributeError'>: 'dict' object has no attribute 'Name'
'dict' object has no attribute 'Name'


comment


I don't know why but ArchMaterial object in the ArchTexture script is resolved as a dictionnary

Code: Select all

material = {'Color': '(0.762905317769131, 0.2041962310215915, 0.03569085221637293)', 'Description': 'tuiles en terre cuite concassées', 'DiffuseColor': '(0.762905317769131, 0.2041962310215915, 0.03569085221637293)', 'Name': 'tuilesConcasées', 'ProductURL': '', 'StandardCode': '', 'Transparency': '0', 'ViewColor': '(0.762905317769131, 0.2041962310215915, 0.03569085221637293)'}
and no more as a real python object? Hence material.Name is not resolved but material['Name'] would.

The thing is that when querying the material objet in freecad python console, the object is well resolved as a real pythonObject.


Sory againt but I hope you've got an Idea on this problem which isn't probably specific to your workbench?

Thanks anyway
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Re: Arch Texture Addon: Help Requests

Post by furti »

No need to excuse. Its important to report bugs when you find them. I appreciaze that a lot.

I had a look and found the problem. It is not about the material property of the objet to texture, it is the material itself that causes a problem. The mazerial has a "Material" property and since some commits it seems to have a "Shape" property too. So it is picked as a candidate for texturing as it looks like a texturable object.

I will try to provide a fix tomorrow.
User avatar
furti
Posts: 344
Joined: Mon Nov 27, 2017 5:27 pm

Re: Arch Texture Addon: Help Requests

Post by furti »

I pushed a fix for this. Now only objects with non null shapes will be candidates for texturing.
danreb
Posts: 57
Joined: Wed Mar 14, 2018 7:27 pm

Re: Arch Texture Addon: Help Requests

Post by danreb »

furti wrote: Fri Aug 23, 2019 4:04 pm I pushed a fix for this. Now only objects with non null shapes will be candidates for texturing.
OK solved with your last git commits.

Thanks a lot
drolli
Posts: 6
Joined: Sat Nov 30, 2019 1:27 pm

Re: Arch Texture Addon: Help Requests

Post by drolli »

Hi furti,
You did a very nice your work with your FreeCAD ArchTextures workbench.
However I am really struggling to understand how I can use it. I have tried to follow the instructions of the workbench readme file (https://github.com/furti/FreeCAD-ArchTextures), and have created a material assigned material to my objects. But I am not able to figure out how performing them:
  • Select the object in the TreeView
  • Right click in the Data Tab and click "Show all"
  • Right click again and click "Add property"
When I right click in the Data Tab there is no context menu that appears where I can select "Show all" and "Add property".
Do I need to use FC 0.19? I use the current stable version 0.18.4.
Thanks for your help!
drolli

Code: Select all

OS: Windows 10
Word size of OS: 64-bit, Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag), Build type: Release, Branch: releases/FreeCAD-0-18
Python version: 3.6.6, Qt version: 5.6.2, Coin version: 4.0.0a, OCC version: 7.3.0
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Arch Texture Addon: Help Requests

Post by vocx »

drolli wrote: Sat Nov 30, 2019 2:22 pm ...
When I right click in the Data Tab there is no context menu that appears where I can select "Show all" and "Add property".
Do I need to use FC 0.19? I use the current stable version 0.18.4.
...
Did you read the information in README.md?
README.md wrote: Texture mapping

Currently Texture Mapping only works with objects that have a Material assigned. All architectural objects have such a property. To create a material, go to the Arch workbench and create a material there. See https://www.freecadweb.org/wiki/Arch_SetMaterial for further details.

...

From FreeCAD 0.19 onwards, it is possible to also texture objects created with other workbenches than the Arch workbench.
To use textures you need objects that have the "Material" property. In 0.18 only architectural objects, like Arch Wall, have such property.

Version 0.19 introduced many new underlying features, one of which is that now you can add properties in real time to any object in the tree view. So, in 0.19 you can add the Material property to any object that you have, whether it was created with Arch Workbench or not.
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