Well, actually It’s a minor problem but it bothers me. I have wroted a small script that creates some mesh. Everythigh works ok except that mesh doesn’t show up in 3d view until I enter in EditMode, manually or through python.
editmode = Window.EditMode() # Storing of EditMode state if editmode: Window.EditMode(0) # Go out from EditMode newMesh = Blender.Mesh.New(Name) # Create a new mesh (vertices and faces are already created) newMesh.verts.extend(vertList) # Append vertices to the mesh newMesh.faces.extend(faceList) # Append faces to the mesh objMesh = Object.New('Mesh', Name) # Create new object objMesh.link(newMesh) # Link mesh wit created object scn = Scene.GetCurrent() # Get current scene for ob in scn.getChildren(): ob.sel = 0 # Deselect all objects scn.link(objMesh) # Put object in to the scene objMesh.sel = 1 # Select created object objMesh.Layers = scn.Layers # Window.EditMode(1) # If I don't enter to edit mode, mesh doesn't show in 3D view Window.EditMode(0) # Exit form EditMode if editmode: Window.EditMode(1) # Restore edit mode Window.RedrawAll()
If anyone see what I’m doing wrong here, please correct me.