<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Show Image from colorComponentData in VRED Forum</title>
    <link>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12849696#M405</link>
    <description>&lt;P&gt;Hi Marc,&lt;/P&gt;
&lt;P&gt;no, you're not missing anything, the mentioned textures from Substance and SVBRDF are currently not part of the API v2 classes.&lt;/P&gt;
&lt;P&gt;So I think the only way right now is to get the images via vrFieldAccess. &lt;BR /&gt;I found we have vrObjectService.getSceneObjectFromId(id) where you can pass an vrFieldAccess(image).getID() from API v1 and get a vrd object back. This function is exposed since some versions but undocumented so please use at the risk of it being renamed or removed in the future.&lt;BR /&gt;A (not so nice) alternative to this function would be to set the image to the diffuse component of a helper plastic material with field access and get the vrdImage from that via API v2...&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2024 15:52:32 GMT</pubDate>
    <dc:creator>sinje_thiedemann</dc:creator>
    <dc:date>2024-06-19T15:52:32Z</dc:date>
    <item>
      <title>Show Image from colorComponentData</title>
      <link>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12831708#M398</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need to create a QIMage or QPixmap from the pixel intArray of the image in (for example) the diffuseComponent.&lt;/P&gt;&lt;P&gt;Im not sure how to choose the QImage.Format or the ByteperLine Parameter. Or maybe im doing something other wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;tempMaterial = vrMaterialEditor.getSelectedMaterials()[0]
tempColorComponentData = vrFieldAccess(tempMaterial.fields().getFieldContainer('colorComponentData'))
tempColorComponent = vrFieldAccess(tempColorComponentData.getFieldContainer('displacementComponent'))
tempImage = vrFieldAccess(tempColorComponent.getFieldContainer('image'))
tempPixel = tempImage.getMUInt8('pixel')
tempWidth = tempImage.getInt32('width')
tempHeight = tempImage.getInt32('height')
tempBpp = tempImage.getInt32('bpp')

tempBytes = bytes(tempPixel)
tempImg = QtGui.QImage(tempBytes, tempWidth, tempHeight, tempWidth*tempBpp, QtGui.QImage.Format_RGB16)
print(tempImg.save(r'd:\aaa.png'))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marcwinter2_0-1718094041391.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1374373iC9D4DF30CA7CA0D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marcwinter2_0-1718094041391.png" alt="marcwinter2_0-1718094041391.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The image still not looks like as expected:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aaa.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1374374i1993A9280F6F6E84/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aaa.png" alt="aaa.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 08:25:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12831708#M398</guid>
      <dc:creator>marc.winter2</dc:creator>
      <dc:date>2024-06-11T08:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Show Image from colorComponentData</title>
      <link>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12836516#M399</link>
      <description>&lt;P&gt;No idea anyone? &lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 05:48:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12836516#M399</guid>
      <dc:creator>marc.winter2</dc:creator>
      <dc:date>2024-06-13T05:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Show Image from colorComponentData</title>
      <link>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12836687#M400</link>
      <description>&lt;P&gt;In the new Python API the vrdImage has a function toQImage that should give you a QImage, I strongly recommend to use that function instead of trying to do the conversion yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to do this manually you will need to check the datatype and in combination with the bpp and pixel format&amp;nbsp; so you can actually derive the proper format for the QImage from it. And you will have to flip the image upside down since QImage uses a top-left origin while we use a bottom-left origin.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 07:45:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12836687#M400</guid>
      <dc:creator>michael_nikelsky</dc:creator>
      <dc:date>2024-06-13T07:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Show Image from colorComponentData</title>
      <link>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12836860#M401</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes i know it in API V2, but i need to show textures (first displacement) from substanceMaterials.&lt;/P&gt;&lt;P&gt;Do you have further Information on datatype, bpp and pixelFormat?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 09:11:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12836860#M401</guid>
      <dc:creator>marc.winter2</dc:creator>
      <dc:date>2024-06-13T09:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Show Image from colorComponentData</title>
      <link>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12837120#M402</link>
      <description>&lt;P&gt;API V2 solution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def getSubstancePropertyValue(_substanceMaterial, _propName):
    tempObject = QtCore.QObject()
    _substanceMaterial.getProperties().update(tempObject, 0)
    for tempPropName in tempObject.dynamicPropertyNames():
        tempPropName = bytes(tempPropName).decode()
        if tempPropName.startswith('__vred_'):
            tempPropValue = tempObject.property(tempPropName)
            tempPropName = tempPropName[len('__vred_'):]
            if tempPropName == _propName:
                return tempPropValue
    return None

tempQImage = getSubstancePropertyValue(vrMaterialService.getMaterialSelection()[0], 'displacementTexture').getImage().toQImage()
print(tempQImage.save(r'd:\aaa.jpg'))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 11:26:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12837120#M402</guid>
      <dc:creator>marc.winter2</dc:creator>
      <dc:date>2024-06-13T11:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Show Image from colorComponentData</title>
      <link>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12840434#M403</link>
      <description>&lt;P&gt;Hi Marc,&lt;/P&gt;
&lt;P&gt;in case you simply want to view the textures in VRED (as your thread title says "Show Image.."), you can do that in the UV Editor. Select an object with the material assigned and in UV Editor enable "Show Texture" (and select which one), and disable "Show Wireframe" (and Grid) to be able to see the texture.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 16:08:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12840434#M403</guid>
      <dc:creator>sinje_thiedemann</dc:creator>
      <dc:date>2024-06-14T16:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Show Image from colorComponentData</title>
      <link>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12846032#M404</link>
      <description>&lt;P&gt;Hi Sinje,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;yes i'm aware of the uvEditor. But i need the images in my own ui, prepared for non expert users.&lt;/P&gt;&lt;P&gt;It started with the displacement but now i need also the other textures, but besides bumpTexture and displacementTexture i found nothing useable:&lt;/P&gt;&lt;P&gt;__vred_objectId "31271"&lt;/P&gt;&lt;P&gt;__vred_graphs "0"&lt;/P&gt;&lt;P&gt;__vred_resetGraph "False"&lt;/P&gt;&lt;P&gt;__vred_syncOutputSize "True"&lt;/P&gt;&lt;P&gt;__vred_textureSettings "&amp;lt;vrKernelServices.vrdTexture object at 0x0000015FE8279F00&amp;gt;"&lt;/P&gt;&lt;P&gt;__vred_common "&amp;lt;vrKernelServices.vrdBRDFCommonSettings object at 0x0000015FE81CB4C0&amp;gt;"&lt;/P&gt;&lt;P&gt;__vred_raytracing "&amp;lt;vrKernelServices.vrdMaterialRaytracingSettings object at 0x0000015FE81CB1C0&amp;gt;"&lt;/P&gt;&lt;P&gt;__vred_roundedEdges "&amp;lt;vrKernelServices.vrdRoundedEdges object at 0x0000015FE81CB4C0&amp;gt;"&lt;/P&gt;&lt;P&gt;__vred_bumpTexture "&amp;lt;vrKernelServices.vrdBumpTexture object at 0x0000015FE81CB1C0&amp;gt;"&lt;/P&gt;&lt;P&gt;__vred_displacementTexture "&amp;lt;vrKernelServices.vrdDisplacementTexture object at 0x0000015FE81CB4C0&amp;gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__vred_textureSettings has an empty image.&lt;/P&gt;&lt;P&gt;I can't find diffuse-, roughness-, metallic- and ao-Textures. Am i missing something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. with vrdSVBRDFMaterials i have similar problems &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Marc&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 07:29:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12846032#M404</guid>
      <dc:creator>marc.winter2</dc:creator>
      <dc:date>2024-06-18T07:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Show Image from colorComponentData</title>
      <link>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12849696#M405</link>
      <description>&lt;P&gt;Hi Marc,&lt;/P&gt;
&lt;P&gt;no, you're not missing anything, the mentioned textures from Substance and SVBRDF are currently not part of the API v2 classes.&lt;/P&gt;
&lt;P&gt;So I think the only way right now is to get the images via vrFieldAccess. &lt;BR /&gt;I found we have vrObjectService.getSceneObjectFromId(id) where you can pass an vrFieldAccess(image).getID() from API v1 and get a vrd object back. This function is exposed since some versions but undocumented so please use at the risk of it being renamed or removed in the future.&lt;BR /&gt;A (not so nice) alternative to this function would be to set the image to the diffuse component of a helper plastic material with field access and get the vrdImage from that via API v2...&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 15:52:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12849696#M405</guid>
      <dc:creator>sinje_thiedemann</dc:creator>
      <dc:date>2024-06-19T15:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Show Image from colorComponentData</title>
      <link>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12861896#M406</link>
      <description>Hi Sinje,&lt;BR /&gt;sorry for taking that long for the answer. That's it. Very nice!!! Thank you very much.&lt;BR /&gt;Best regards,&lt;BR /&gt;Marc</description>
      <pubDate>Wed, 26 Jun 2024 08:48:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/show-image-from-colorcomponentdata/m-p/12861896#M406</guid>
      <dc:creator>marc.winter2</dc:creator>
      <dc:date>2024-06-26T08:48:53Z</dc:date>
    </item>
  </channel>
</rss>

