
It seem that Mesh is in NameSpace 'CLR.Microsoft.DirectX.Direct3D' but is define in the DLL : Microsoft.DirectX.Direct3DX.dll so I try that: a = Assembly.LoadWithPartialName("C:\...\Microsoft.DirectX.Direct3DX.dll") from CLR.Microsoft.DirectX.Direct3D import Mesh But doesn't work. If i well understand, 'from CLR.Microsoft.DirectX.Direct3D import Mesh' try to import 'Mesh' from CLR.Microsoft.DirectX.Direct3D.dll not CLR.Microsoft.DirectX.Direct3DX.dll , isn't it ? The both dll share the same NameSpace. ----- Original Message ----- From: "Brian Lloyd" <brian@zope.com> To: "Laurent Caumont" <lcaumont@pamdev.com> Cc: <pythondotnet@python.org> Sent: Thursday, January 22, 2004 4:02 PM Subject: RE: Problem whith DirectX Mesh importation
"from CLR.Microsoft.DirectX.Direct3D import Mesh"
=> ImportError: cannot import name Mesh
It seems that 'Mesh' is define in the Direct3DX library because when I remove the reference the "Microsoft.DirectX.Direct3DX" in the reference list in a directx C# sample, I have the same error...
How can I add a refrence like in C# ?
The "import CLR.Microsoft.DirectX.Direct3DX as D3DX" doesn't work.
Thanks for help.
What is the actual name of the _assembly_ that implements the Direct3DX library?
Remember that the name-based import in Python is linked to namespaces, and 'implicit assembly loading' only happens if the namespace you are trying to import happens to match the name of the assembly implementing it (which luckily is often, but not always, the case).
So for example, if the assembly is actually named 'Direct3DX.dll', you'll need to load the assembly explicitly before attempting to import the namespace, since the names don't match. There is an example of this in the README for Python for .NET:
from CLR.System.Reflection import Assembly
a = Assembly.LoadWithPartialName("SomeAssembly")
# now we can import namespaces defined in that assembly
from CLR.SomeNamespace import Something
Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com