sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Reply
 
Thread Tools
Normal's Avatar
Normal Normal is offline
Member
 
Join Date: Jul 2003
Posts: 58
Wings' obj exporter now exports smoothing groups based on the hard edges in your model, and Blender can import and use the groups with the edgesplit modifier. I rarely use edgesplit, but I use creases on most all of my models. As I don't think it exists, I want to try to make an edgesplit to creases convertor (emphasis on try) and was wondering it's possible . Searching through the API docs, I found that they at least mention creases, but can't seem to find anything about edgesplit.

This is how I think it could go: 1. Select sharp edges 2. Clear Sharp selected edges. 3. Crease selected edges +1.0 3. Doable?
............................................
I hate spoons.....
#1   Old 21-Jul-09, 05:18   
Reply With Quote


Briggs's Avatar
Briggs Briggs is offline
Member
 
Join Date: Mar 2002
Posts: 1,103
Quote:
Originally Posted by Normal View Post
Wings' obj exporter now exports smoothing groups based on the hard edges in your model, and Blender can import and use the groups with the edgesplit modifier. I rarely use edgesplit, but I use creases on most all of my models. As I don't think it exists, I want to try to make an edgesplit to creases convertor (emphasis on try) and was wondering it's possible . Searching through the API docs, I found that they at least mention creases, but can't seem to find anything about edgesplit.

This is how I think it could go: 1. Select sharp edges 2. Clear Sharp selected edges. 3. Crease selected edges +1.0 3. Doable?
The following code will do what you need, quick script really...

Code:
import Blender def convert(): editmode = 0 if Blender.Window.EditMode(): editmode = 1 Blender.Window.EditMode(0) scene = Blender.Scene.GetCurrent() act = scene.objects.active mesh = None if act and act.type == 'Mesh': mesh = act.getData(mesh = True) for edge in mesh.edges: if edge.flag & Blender.Mesh.EdgeFlags["SHARP"]: edge.crease = 255 edge.flag &= ~Blender.Mesh.EdgeFlags["SHARP"] if editmode: Blender.Window.EditMode(1) convert()
Cheers,
Briggs
............................................
Briggs
#2   Old 21-Jul-09, 05:35   
Reply With Quote
Normal's Avatar
Normal Normal is offline
Member
 
Join Date: Jul 2003
Posts: 58
You, sir, are awesome. Works like a charm. I'm now inspired to try my best to learn the API. I only know a bit of Pygame(half through a book), but now I think I'll spend some time with learning some Blenderness. Thank you very much.
............................................
I hate spoons.....
#3   Old 21-Jul-09, 06:49   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 11:40.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists