Forum

Author Topic: activeChunk.buildTexture - mapping="Camera"  (Read 6218 times)

James

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
activeChunk.buildTexture - mapping="Camera"
« on: May 20, 2013, 01:37:27 PM »
Hi there,

This is my first dabble in python programming in photoscan, and my first dabble in python for over 10 years so please excuse my ignorance!

I am just trying individual commands in the console window at present, trying to get it to build texture from a single image.

I have a chunk with 17 aligned cameras and geometry already present (93k faces).

My problem is that having finally worked out how to access cameras and frames, the buildTexture function executes happily but returns false, i.e. the texture is not built.

Does anyone know if I am far off getting this to work?!

Thanks

James

Code: [Select]
>>> import PhotoScan
>>> doc = PhotoScan.app.document
>>> camera = PhotoScan.Cameras(doc.activeChunk)[7]
>>> frame = PhotoScan.Frames(camera)[0]
>>> doc.activeChunk.buildTexture(mapping="camera",width=2048,height=2048,format="U8",camera=frame)
False

Finished processing in 0 sec (exit code 0)
>>>

James

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Re: activeChunk.buildTexture - mapping="Camera"
« Reply #1 on: May 22, 2013, 01:23:46 PM »
This was fixed in build 1684.

In case anyone else is interested the working code is now something a bit like this:

Code: [Select]
import PhotoScan
chunk = PhotoScan.app.document.activeChunk
cam = chunk.cameras[0]
chunk.buildTexture(mapping="camera",width=2048,height=2048,format="U8",camera=cam)

Thanks Dmitry for the quick response!