Macro Texture Objects/ru: Difference between revisions
(Created page with "{{Macro/ru |Icon=Text-x-python |Name=Texture Objects |Description=Этот макрос позволяет временно поместить текстуру на выбра...") |
(Updating to match new version of source page) |
||
Line 11: | Line 11: | ||
{{clear}} |
{{clear}} |
||
{{Code|code= |
|||
<syntaxhighlight> |
|||
import FreeCADGui |
import FreeCADGui |
||
Line 27: | Line 27: | ||
rootnode.insertChild(tex,1) |
rootnode.insertChild(tex,1) |
||
}} |
|||
</syntaxhighlight> |
|||
{{clear}} |
{{clear}} |
||
<languages/> |
<languages/> |
Revision as of 10:48, 25 September 2016
File:Text-x-python Texture Objects |
описание |
---|
Этот макрос позволяет временно поместить текстуру на выбранный объект. Для удаления текстуры, просто закройте и вновь откройте документ. автор : yorik |
автор |
yorik |
Скачать |
None |
Links |
Макросы рецепты Как установить макросы Как настроить панели инструментов |
Версия |
1.0 |
Дата последней модификации |
None |
Версии FreeCAD |
None |
Ярлык по умолчанию |
None |
Смотрите также |
None |
This macro allows you to temporarily put a texture image on selected objects. To remove the textures, simply close and reopen the document.
import FreeCADGui
from PySide 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[0])
rootnode.insertChild(tex,1)