Search found 9 matches

by AgentCain
Sun Dec 09, 2012 12:19 pm
Forum: Python
Topic: Get a camera's view and send it through socket communication
Replies: 14
Views: 3339

Solved the problem
Apparently, one script execution doesnt work. On the second run you have depth results
Now its a matter of remapping the values from [min,1] to [0,1] or [0,255]
by AgentCain
Fri Dec 07, 2012 10:48 am
Forum: Python
Topic: Get a camera's view and send it through socket communication
Replies: 14
Views: 3339

Ok
So for my first try, I used glReadPixels on the GL_DEPTH_COMPONENT

but, it returns a matrix of 1.0 :(
Whats the problem?
by AgentCain
Sun Dec 02, 2012 10:03 am
Forum: Python
Topic: Get a camera's view and send it through socket communication
Replies: 14
Views: 3339

Big Time. Major differences between the 2.4x series and 2.6x - both internally and in the BPy API. Oh, and the user interface, too! I guess i should try an older version then :P Note the Z-buffer is only the depth information, a single float for each pixel, like a height map or gray scale image. Ac...
by AgentCain
Sat Dec 01, 2012 4:07 pm
Forum: Python
Topic: Get a camera's view and send it through socket communication
Replies: 14
Views: 3339

I found this on blenderartists.org: http://blenderartists.org/forum/showthread.php?175693-Access-Z-buffer-and-save-it-as-file Alternatively you could use the z-buffer of the 3d-view. Here's some code to do that: import Blender from Blender import * from Blender.BGL import * windows = Window.GetScree...
by AgentCain
Sat Dec 01, 2012 2:01 pm
Forum: Python
Topic: Get a camera's view and send it through socket communication
Replies: 14
Views: 3339

you could try to expose the pixels (Image.pixels) of an image for render results, this is current available to python for images, movies and uv test textures (not generated textures). So image.pixels gives a matrix-like access to a rendered scene's pixel data? I guess I could pass this through and ...
by AgentCain
Sat Dec 01, 2012 1:18 pm
Forum: Python
Topic: Get a camera's view and send it through socket communication
Replies: 14
Views: 3339

how about something like bpy.ops.render.opengl() bpy.data.images['Render Result'].save_render("D:\\viewport_render.png") ? The thing is I want to avoid writing to a file because it will be extremely slow writing lets say 50 .png and then open them. Of course I could use a Ramdisk partition to gain ...
by AgentCain
Fri Nov 30, 2012 7:19 pm
Forum: Python
Topic: Get a camera's view and send it through socket communication
Replies: 14
Views: 3339

Could you propose any method? All I could find is bpy.data.scenes[].camera = obj bpy.data.scenes[].render.file_format = 'JPEG' bpy.data.scenes[].render.filepath = '//camera_' + str(c) which is useful for saving a rendered scene as an image by calling bpy.ops.render.render( write_still=True ) The ble...
by AgentCain
Thu Nov 29, 2012 9:27 pm
Forum: Python
Topic: Get a camera's view and send it through socket communication
Replies: 14
Views: 3339

I just had an idea

Since you can load the result of opengl to opencv using glReadPixels(), I probably could do the same through the Blender's opengl wrapper

Will try and report. If anyone else has another solution, please dont be shy :P
by AgentCain
Thu Nov 29, 2012 1:01 pm
Forum: Python
Topic: Get a camera's view and send it through socket communication
Replies: 14
Views: 3339

Get a camera's view and send it through socket communication

I am working on a server-client system which will estimate a person's pose I would like to have blender function as a server, using python scripting and socket communication. It will manage a human articulated model, take as input the joints position (or movement in general) and respond with the mod...