Mesh vs NMesh

To Mesh or not to NMesh?
This is the problem.

I have been following the development discussion…
but this matter is quite confusing to me, so I decided to
post this doubts.

What is the future?
Mesh or NMesh?

From the docs I see that NMesh will be discarded…or
…this is what I have understood!!

From my experience I see that NMesh provide a deeper
acces to the raw object, I mean:
in the export routine if an objects has been subdivided
the mesh is exported subdivided.

Using Mesh don’t provide such advantage.

The mesh is exported with the “original” faces.
So, no subdivision.

The new FunBlender (and the Creator versions that I compiled)
gives errors when importing NMesh.
While Publsher accepts both.

So, this make me think that I have to began to think to
count only on Mesh module.

It is right?

Exported with povanim from Publisher original:

Exported with povanim from FunBlender original:

As Mesh module desappear from FunBlender (and from other compilations too), it seems that there is no futur for this approch.

As Mesh module desappear from FunBlender (and from other compilations too), it seems that there is no futur for this approch.

I still get confused…which module will disappear from the PythonAPI?

Sorry jms …
anyway I will take a look at your povanim…
Andrea

…which module is yet in the PythonAPI?

import Blender
l=dir(Blender)
for n in l:
   exec "print n, 'contient;'; print 
dir(Blender."+n+")"
   x=raw_input('pause...')

[Post] Posted: Sun Jan 19, 2003 9:01 pm Post subject:
…which module is yet in the PythonAPI?

Well, Publisher got both…FunBlender use Mesh.

And a quick look at the source answer the question.
NMesh.py:

“”"The Blender NMesh module

This module provides access to the raw Mesh data block.

Examples will not be given, as the life time of this module will be
most probably limited. Use the ‘Mesh’ module instead.
“”"

But NMesh and Mesh doesn’t do the same thing…
…from my tests on YaBle I see that exporting using Mesh don’t give the opportunity
to access the same data that I can access using NMesh.

NMesh ->GetRawFromObject()
Mesh?

I would like to know how to export an object with the subdivided faces.
With Mesh I was able to export only the original set of faces…

i.e.
A subdivided cube with NMesh is exported fine.
The same using Mesh is exported “as is” (six faces).

Andrea

Is this a new Funblender?
In The one I used a week ago there is only “NMesh”.

More: look at closely to the publisher sources, precisely in the
file named: intern\python\modules\mesh.py the lines under 50th
Funny, isn’t it?

Ehhhh??
I’ve understad right???
NMESH deleted??? :o
Why don’t delete all python API instead??
Or all Blender code?

Excuse me…I’m very nervous about this
strange and very destructive changement!!!

We must rewrite all script…
Why?? :<

I remember again the problem with the “new” 210 module…

Why???

This is a bit dramatic interpretation of top lines of this:

http://www.blender.org/modules/documentation/225PythonDoc/NMesh.py.html

but that was written by NaN when following their lines of development.

I’d bet now many things have changed

Stefano

S68 is right, don’t pay much attention to what is in the docs, they were part of plans back then. Besides that it was never completed, parts of the new API don’t work properly, NaN went bankrupt in the midst of development, lots of things were still being tested at that point (with the help of the now defunct ‘BlenderLeague’). Just keep using NMesh, until something ‘official’ comes along.
As for the ‘funblender’, as far as I understand, these are experimental releases, nothing official, so don’t base an entire script on that.
btw, I also have only NMesh in ‘funblender’, not Mesh.

Ok, I hope that other like me that incurred in this mismatch
now get things clear!!

Now it is clear.
Sorry jms…I visit my windows partition only few times…
I tried Fun Blender and changed the import…
I was sure that was NMesh out, not Mesh…
I remembered the wrong module…

OK, LET’S USE NMESH !

I hope that the following lines will justify me!!

:expressionless:

These are the funny lines:
from NMesh.py

def GetRawFromObject(name):
“”“This returns the mesh as used by the object, which
means it contains all deformations and modifications.”“”
pass

override all these functions again, because we only used them for

documentation – NMesh will be no longer supported in future

New = _NMesh.New
GetRaw = _NMesh.GetRaw
PutRaw = _NMesh.PutRaw
GetRawFromObject = _NMesh.GetRawFromObject
Const = _NMesh.Const
Vert = _NMesh.Vert
Face = _NMesh.Face
Col = _NMesh.Col

And the one pointed by jms in Mesh.py:

from Blender.Types import NMFaceType
import Blender.Material as Material

from _Blender import NMesh as _NMesh

In Mesh.py do not forget:


def makeFace(f):
	face = _NMesh.Face()
	for v in f:
		face.v.append(v)
		face.uv.append((v.uvco[0], v.uvco[1]))
	return face

or always in Mesh.py


def Color(r, g, b, a = 1.0):
	return _NMesh.Col(255 * r, 255 * g, 255 * b, 255 * a)

… further:


Vert = _NMesh.Vert
Face = _NMesh.Face

class rawMesh:
	"""Wrapper for raw Mesh data"""
	def __init__(self, object = None):
		if object:
			self._object = object
		else:	
			self._object = _NMesh.GetRaw()

		self.flags = DEFAULTFLAGS
		self.smooth = 0
		self.recalc_normals = 1
		self.faces = self._object.faces[:]
....

etc.

These comments in the py modules are probably still from Strubi (Martin Strubel) who was the last person to work on Blender’s Python API.
I guess if you really want to be sure about future plans for the API, ask on blender.org. But I don’t think there are as of yet any concrete plans though, only idea’s as far as I know.