08-20-2010, 06:52 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
The mesh creation looks like(simplifed):
Code: mesh = Blender.Mesh.New()
mesh.verts.extend([Vector(v.co) for v in self.verts])
mesh.faces.extend([f.vertex_index for f in self.faces])
for i in range(len(mesh.faces)):
ti = self.faces[i].texture_index
uv = [Vector(self.texcoords[ti[0]].uv()), Vector(self.texcoords[ti[1]].uv()), Vector(self.texcoords[ti[2]].uv())]
mesh.faces[i].uv = uv
I have no idea what could go wrong here. But there are still broken uv faces.
[/list]
|
|
08-22-2010, 04:43 AM,
|
|
thelusiv
Administrator
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
NaN, I've looked at your new Blender scripts. Are these the latest versions? They look very good.
The biggest thing for which the old trackeditor must still be used, it seems, is to create roads.trk if you don't have one to import.
I'm thinking about writing a graphical interface for all these scripts using the Blender Draw module:
http://www.blender.org/documentation/249...odule.html
What kind of features would be good? Here are some I've thought of... - set attributes about the track:
- output directory
- name
- author
- license
- ...
- provide a set of different object profiles, which can be applied to objects to auto-fill the property values (does Blender already have this? all I can find is Object -> Copy Attributes -> Properties...)
- grass
- concrete
- sand
- skybox
- ...
- save all these track attributes and object profiles with the .blend file (in the .blend file?)
- choose which mesh is the track
- setup objects that are not exported but used as starting points
- specify some vertices as the starting line
- an "Export Track" button that creates objects.jpk, list.txt, roads.trk, track.txt, surfaces.txt, copies all graphics, and everything else which needs to be done, to get a track into VDrift
|
|
08-22-2010, 02:33 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Quote:What kind of features would be good?
I've planned to rewrite the track description format. To allow mesh instances(position orientation) and dynamic track objects(physics) and other stuff. I am a bit stuck on the object instances detection script. And the face indices bug hit by Alex is another show stopper.
It looks like blender is changing the face indices ordering for whatever reason. :x
track_verge19mergepart3.dof-00.joe original:
Code: [0, 1, 2]
[0, 2, 5]
[6, 7, 8]
[5, 2, 11]
[10, 1, 0]
[10, 9, 1]
[4, 9, 10]
[4, 3, 9]
[8, 3, 4]
[8, 7, 3]
track_verge19mergepart3.dof-00.joe as mesh:
Code: [MFace (0 1 2) 0]
[MFace (0 2 5) 1]
[MFace (6 7 8) 2]
[MFace (5 2 11) 3]
[MFace (1 0 10) 4]
[MFace (10 9 1) 5]
[MFace (4 9 10) 6]
[MFace (4 3 9) 7]
[MFace (8 3 4) 8]
[MFace (8 7 3) 9]
Compare the fifth face.
|
|
08-22-2010, 08:20 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
NaN Wrote:It looks like blender is changing the face indices ordering for whatever reason. :x i don't understand what's going on either. i've been fixing a lot of these faces in blender and then they look right in both blender and vdrift. vdrift must be doing something extra to display them right in the first place (or maybe blender is doing something extra that vdrift ignores resulting in the faces being rotated. it's interesting to note that they are always rotated 90 degrees sometimes clockwise, sometimes anti-clockwise).
--alex--
|
|
08-23-2010, 09:48 PM,
|
|
portets
Member
|
Posts: 152
Threads: 12
Joined: Apr 2009
|
|
will the import/export scripts work with blender 2.5? and are there any new features in 2.5 that the scripts could take advantage of? 2.5 is going to be a major release.
i figure this question isn't deserving of a new topic
|
|
08-24-2010, 08:19 AM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
Code: will the import/export scripts work with blender 2.5
Not until someone rewrites them. They've changed a lot of things in 2.5. I think the whole GUI and all operations(actions) are scriptable now. But the python API is quite unstable atm. They have been renaming a lot on the python side recently. I'd wait untill a stable release is out.
The 21 character limit for names is still there
|
|
|