Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Maxunderground news unavailable

Scripting Theory Question
show user profile  9krausec
Hey guys, got a question for some of the larger brains on this forum...

So I have a script that reduces all polygons per object in a scene evenly (optimizing for obj export). If I wanted to work towards a solution to automatically dictate which specific geometry needed more optimization (flat sweeping surfaces) and which geo couldn't handle much (tight bends). Where would I start?

This is in regards to imported CAD data. So I'm dealing with a "adaptive" "tessellated mesh. Flat, long surfaces have lower poly density than tight turns/curves.

Not looking for syntax here, just some light theory... I was thinking it would have to include calculating the edge length of each edge on a mesh and somehow taking those values and pushing them into a fraction of sorts that would then be pushed to drive how much or how little optimization happens per object...

Does that sound along the correct lines?

I'm not looking to have a wide gamut of percent mesh objects are optimized in relation to one another, but I'd think a 20% difference would meet my needs (so no mesh would exceed or go below 20% of a certain optimization value).

I've sort of been consumed by scripting lately.... Been working 12-14 hour days the last 2-3 weeks because apparently I get too sucked into this stuff. Damn python!!! :D

And thanks for any replies/input.

edit: and I'm referring to complete objects when I talk about optimization level. Like "this twisty object that is wrapping around this cube has a lot of twists to it, probably needs lower optimization because the outline/shape needs to be retained.. But to hell with that cube it's wrapped around... That doesn't need any polys."..

- Portfolio-

read 349 times
4/24/2015 7:29:15 AM (last edit: 4/24/2015 7:34:50 AM)
show user profile  Garp
I think the best approach would be to look at implementations from free graphics library, SIGGRAPH articles, Microsoft Research, etc. There are just too many aspects to consider than could be described in a forum post.
On the other hand, since you still have 10-12 hours of free time per day (who needs sleeping, eh?), you could learn the ins and outs of algorithms and data structures in general and computational geometry in particular ;)

That being said, since you already have an optimization scheme going, you could select the areas to optimize based on the angle between the normals of adjacent triangles. It's quick and dirty, but sometimes it's all you need.

read 336 times
4/24/2015 8:27:03 AM (last edit: 4/24/2015 8:32:22 AM)
show user profile  herfst1
I just emailed Mark Hunanyan, we'll have the definitive answer soon.
read 327 times
4/24/2015 9:09:58 AM (last edit: 4/24/2015 9:09:58 AM)
show user profile  9krausec
@Garp- Free graphics lib? Is this it-

After looking at that it seems I'm probably biting off more than I can chew... I don't mind writing as much code as needed, but I'm trying to avoid having to cross pollinate with other solutions. Goal here is to stick in Python/Maya.

@herfst1- Thanks buddy. (edit: wow, I'm dense. hahaha. I take my thanks back.)

I have a few different approaches I'm thinking about taking and will keep this thread up-to-date. I find this stuff pretty interesting.

- Portfolio-

read 311 times
4/24/2015 3:41:23 PM (last edit: 4/24/2015 3:44:07 PM)
show user profile  Garp
As I'm not using python, I don't know first hand but with the staggering amount of free libraries in python, chances are that what you're looking for already exists. It would just be a matter of hooking it up.
Did you google for 'graphics library in python' or similar?

read 295 times
4/24/2015 4:51:39 PM (last edit: 4/24/2015 4:51:39 PM)
show user profile  9krausec
^I was trying to do everything for the canned python to make the whole toolset easier to transfer to different machines.

I'll look into this though, thanks for the advice.

- Portfolio-

read 273 times
4/25/2015 3:13:20 PM (last edit: 4/25/2015 3:13:20 PM)
show user profile  Garp
Actually, I might have been too optimistic. I searched a little but couldn't find anything in python.
Here is a module from the CGAL library (C++). Perhaps you can extract something useful from the documentation or the code.

read 272 times
4/25/2015 3:32:36 PM (last edit: 4/25/2015 3:32:48 PM)
#Maxforums IRC
Open chat window