How to make flat faces/sharp edges?

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Re: How to make flat faces/sharp edges?

Postby Christian Walther » Sat Jun 28, 2008 3:36 am

OK, I seem to be able to achieve export of modified meshes using this simple change:

Code: Select all
--- gow-pyprp-1.4.0/src/alc_DrawClasses.py   2008-05-22 23:34:46.000000000 +0200
+++ /Users/cwalther/.blender/scripts/alc_DrawClasses.py   2008-06-28 12:08:53.000000000 +0200
@@ -1606,6 +1606,10 @@
         # build up a weight map if neccessary, and fill it with the default value to start with
         if len(mesh.getVertGroupNames()) > 0:
             WeightCount = 1 # Blender supports only one weight :)
+        else:
+            # I don't know what to with modified meshes and vertex groups, but since we don't have any, let's use the mesh with modifiers applied
+            mesh = Mesh.New()
+            mesh.getFromObject(obj)
 
         # Now, we need to make groups of faces for each assigned material :)
 


Now, whether this is sufficient for more complex objects than I have in my doodle age, whether it breaks anything else (there may be more things than mesh.getVertGroupNames() that fail when the mesh is not connected to an object), and whether anything better can be done about the vertex groups/WeightCount thing (about which I haven't educated myself yet), these are more difficult questions...
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: How to make flat faces/sharp edges?

Postby Trylon » Sat Jun 28, 2008 12:12 pm

Interesting
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
User avatar
Trylon
 
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
Location: Gone from Uru

Re: How to make flat faces/sharp edges?

Postby Christian Walther » Sun Jul 06, 2008 9:36 am

I've ported the modification over to PyPRP 1.5, and it appears to work as well as in 1.4, there have only been cosmetic changes to that area. (I guess I should switch to the SVN version some time.) I will keep using it and see if it causes me any difficulties - though, in my personal use, I'm unlikely to attain any significant coverage of all cases that could go wrong anytime soon.
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: How to make flat faces/sharp edges?

Postby Christian Walther » Wed Jul 16, 2008 10:03 am

The modification is now committed in the http://svn.guildofwriters.com/pyprp/contrib/CWalther/experimental branch, if anyone would like to give it a try without having to patch files themselves.
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Re: How to make flat faces/sharp edges?

Postby Paradox » Wed Jul 16, 2008 1:26 pm

How does this affect other modifiers? Do things like subsurf export without being applied?

Another question is whether this causes issues for objects that do not have modifiers attached. Does it increase the size of exported vertex data at all? (for objects without modifiers)
Paradox
 
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: How to make flat faces/sharp edges?

Postby Christian Walther » Thu Jul 17, 2008 1:09 am

Paradox wrote:How does this affect other modifiers? Do things like subsurf export without being applied?

As far as I understand it should apply all modifiers. For Subsurf, the refined mesh is exported. I've only tried it on an untextured object so far, so I don't know what it does to vertex colors and UV coordinates, but I see no reason why it couldn't treat these gracefully (by interpolating in some way). Update: Yep, it indeed does. Nothing to worry about.

I haven't tried any other modifiers than EdgeSplit and Subsurf yet.

Another question is whether this causes issues for objects that do not have modifiers attached. Does it increase the size of exported vertex data at all? (for objects without modifiers)

As far as I can tell it shouldn't, and for the simple objects where I've checked explicitly it didn't - m = Mesh.New(); m.getFromObject(obj); m.verts seemed to be an exact copy of obj.getData(mesh=True).verts, dito for .faces. But being a Blender newbie it may well be that I'm missing something.

Maybe it would make sense to only use this for objects that have modifiers, to be safe, like I'm already excluding objects that have vertex groups. (In a final version, there should still be a warning if an object has both modifiers and vertex groups.)
Christian Walther
 
Posts: 443
Joined: Sun Jun 08, 2008 3:10 am
Location: Switzerland

Previous

Return to Building

Who is online

Users browsing this forum: No registered users and 0 guests