I’d like to script in python the command (which can be found in editmode) “limit selection to visible vertices” to select only the visible vertices of my mesh. In the Blender API, you can find mesh.verts.sel=1. But you can only select all or no vertices. I didn’t find anything else in the Blender API, so could you help me please?
After the selection is done, I would seperate the visible vertices of my mesh from the ones that are not visible. How could this be scripted in python?Many thanks in advance for your help!
What I mean by “select only visible vertex” is, to select in 3D view all visible vertexes (clipped with z-buffer). Hm. Do you understand what I mean? I just want to programm the same thing as the button “vertex select mode” and the button “limit selection to visible” (that has to be ON) in blender (Version 2.42, in editmode) do. You certainly know where this button can be found. It’s in the right corner of the 3D View Window.
And:
Why do I have to leave editmode (with (0) ) to modiy my mesh?
If you want to click the button “select visible vertex”, you have to be in editmode to see it. ?!? Is it no the same for programming this command? First change to editmode, select those visible vertex and then leave editmode? Maybe, I’m wrong?
Python dosnt do this kinda stuff well, (zbuffer clipping from the 3d view not at all)
if you realy really wanted you could do it in python but this stuff is best done in C. dont waist time in python for realy intergrated tools.
You need to be out of editmode to edit mesh data becayse editmode data is a special temp datastructure that Python dosnt wrap.
(editmode mesh is being rewritten and a python wrapper will be made for this! )
hm, ok, thanks! Maybe you could post me a piece of code in C for doing this stuff (I mean, select visible vertex) :). I can’t handle C nor C++.
What I want to do is really simple: Pick the visible vertexes and put them in an other layer. But for coding this, it’s not really simple 'cause i didnt find anything useful for this job in the API.
I don’t know the command border select + H. Only border select. So the whole thing I want to do or I’ve already done is to import data, create a mesh with those data, show them in the 3Dview, then texture this mesh from the camera view (it’s called camera mapping, if you don’t know how this works: look at the videotutorial from blendernation) and then, in order to export all visible vertices from this textured modell into an other layer I have to separate the mesh into 2 independent objects. The back side from the mesh is not textured, only the front side where the camera looks to it. So, after exporting the textured part of the mesh, the other part remains untextured and this is going to be textured from an other camera (which has an other position than the other cam) and so on and so on… And because this work isvery repetitive, I dediced to programm it. and that’s why I need to know how I can select those visible vertices. Does it help? An idea came to my mind: Maybe, I should select the textured vertices, but I don’t have any uv-coordinate, because the texture is projected from the camera. Hm.
(oops I meant layers)
I think this is alredy possible using modifiers,
you can set up 6 cameras and use a UVproject modifier with 6 projectors.
The faces will lock to the best camera
Hm, could you explain me, how a UVproject modifier works? Or maybe you can give me a link to a tutorial. The 6 projectors are the camera, aren’t they? Thx