Categories:
-
3d 96 articles
-
animations 16 articles
-
architecture 47 articles
-
blender 98 articles
-
bédé 19 articles
-
techdrawing 24 articles
-
freecad 189 articles
-
gaming 1 articles
-
idsampa 8 articles
-
inthepress 8 articles
-
linux 57 articles
-
music 1 articles
-
nativeifc 30 articles
-
opensource 266 articles
-
orange 4 articles
-
photo 16 articles
-
projects 35 articles
-
receitas 176 articles
-
saopaulo 18 articles
-
sketches 163 articles
-
talks 25 articles
-
techdrawing 24 articles
-
textes 7 articles
-
trilhas 3 articles
-
urbanoids 1 articles
-
video 47 articles
-
webdesign 7 articles
-
works 151 articles
Archives:
-
2007 22 articles
-
2008 32 articles
-
2009 66 articles
-
2010 74 articles
-
2011 74 articles
-
2012 47 articles
-
2013 31 articles
-
2014 38 articles
-
2015 28 articles
-
2016 36 articles
-
2017 41 articles
-
2018 46 articles
-
2019 59 articles
-
2020 18 articles
-
2021 20 articles
-
2022 7 articles
-
2023 25 articles
-
2024 14 articles
Hi Yorik,
Hi Yorik,
Thanks for you posting on texture mapping. I am having some issues with it, could you suggest a solution please? Here is what I posted on the issue:
Texture Mapping, On Individual Objects
Postby rogerzimmerman » Wed Nov 23, 2011 1:34 am In Freecad I want to put textures (from images) onto objects. I am having some difficulty in getting this working as I require, so any solutions are appreciated.
I am using Windows 7.
I can import an .jpg or .png image into the drawing, but it just goes to the 0,0,0 location, and not sure how to manipulatite it (with python scripts) to place it in the many different locations that I need it in my drawing. And this is also not really texturing, because I would need to place it over the exact size of any objects that I move it to.
So I found the "texture mapping" feature, but it puts the texture on "all" objects, not just on the the selected objects.
So I found a python macro that asks for a .jpg image file and uses it as texture on the object(s) selected, the macro is located at:
Yorik's link here....
import FreeCADGui from PyQt4 import QtGui from pivy import coin
get a jpg filename
jpgfilename = QtGui.QFileDialog.getOpenFileName(QtGui.qApp.activeWindow(),'Open image file','*.jpg')
apply textures
for obj in FreeCADGui.Selection.getSelection(): rootnode = obj.ViewObject.RootNode tex = coin.SoTexture2() tex.filename = str(jpgfilename) rootnode.insertChild(tex,1)
I tried this out, and oddly it removes any texturing from the object, and even if I use the "texture mapping" feature again, the texture never goes back onto the object that I applied the Macro to. The Macro pops open a window and asks which jpg file to use for the texturing. I tried it as both a macro and as scripts in the Python console, and the results are the same.
As a workaround, I could apply this macro to all the objects except the one I want to apply texturing, which means I could only texture one type of object in the drawing. So it is fairly inconvenient.
I would prefer if the macro would actually apply the texture only to the objects selected, this would be ideal.
Any suggestions on this issue?
Thanks
Roger