Topic: Porting problem...  (Read 5971 times)

0 Members and 1 Guest are viewing this topic.

Offline Centurus

  • Old Mad Man Making Ship Again....Kinda?
  • Captain
  • *
  • Posts: 8505
  • Gender: Male
Re: Porting problem...
« Reply #20 on: June 28, 2010, 04:29:11 pm »
Na, it's cool.  I didn't know you gotta relocate them each time.  Now that I know, I think I'll be ok.  I'm reinstalling both MAX 5 and MAX 9 again right now.  Just in case.
The pen is truly mightier than the sword.  And considerably easier to write with.

Offline Centurus

  • Old Mad Man Making Ship Again....Kinda?
  • Captain
  • *
  • Posts: 8505
  • Gender: Male
Re: Porting problem...
« Reply #21 on: June 28, 2010, 09:07:11 pm »
Ok, now for some reason the Split Edges script won't work.
The pen is truly mightier than the sword.  And considerably easier to write with.

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: Porting problem...
« Reply #22 on: June 28, 2010, 09:07:46 pm »
Can you be a bit more specific?
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline Centurus

  • Old Mad Man Making Ship Again....Kinda?
  • Captain
  • *
  • Posts: 8505
  • Gender: Male
Re: Porting problem...
« Reply #23 on: June 28, 2010, 09:14:17 pm »
Attached is the error I get when trying to run it.
The pen is truly mightier than the sword.  And considerably easier to write with.

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: Porting problem...
« Reply #24 on: June 28, 2010, 09:15:16 pm »
Hang on a sec, let me look into my script.
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: Porting problem...
« Reply #25 on: June 28, 2010, 09:38:32 pm »
I can't seem to find the cause of the problem, but I'm coding up an alternative as we speak.

better yet, I found another script that did work with your model.

Code: [Select]
theEP = selection[1].baseobject --get the base object of the selected object

----------Define edge list of all non open edges in object
edgeCount = polyOp.getNumEdges theEP --edges total
openEdgesBitArray = polyOp.getOpenEdges theEP-- all open edges as bitArray
edgeCount
edgeSelArray = #()

k = 1
for i = 1 to edgeCount do
if openEdgesBitArray[i] == false then
(
edgeSelArray[k] = i
k = k + 1
)

HardEdgesArray = #()

sg_bin_array = #{}

sg_bin2_array = #{}

--edgeSelArray
--edgeSelArray.count


-------- functions for converting decimal value to binary
fn dec2bin1 deci =
(
if deci != undefined then
(
dec2bin = ""
deciT = 0.0
s = ""
ost = 0
do
(
deciT = deci / 2
ost = deci - (deciT as integer * 2)
deci = deciT as integer
s = (ost as integer) as string + s
)
while (deci as integer) != 0
dec2bin = s
)
)

fn dec2bin2 deci =
(
if deci != undefined then
(
dec2bin = ""
deciT = 0.0
s = ""
ost = 0
do
(
deciT = deci / 2
ost = deci - (deciT as integer * 2)
deci = deciT as integer
s = (ost as integer) as string + s
)
while (deci as integer) != 0
dec2bin = s
)
)


FOR J = 1 to edgeSelArray.count do --GLOBAL LOOP check around all edges for hardness
(


polys = polyOp.getEdgeFaces theEP edgeSelArray[J] --get polys of selected edge

--polys

sg = polyOp.getFaceSmoothGroup theEP polys[1] --get smoothing groups from poly 1 as decimal
sg_bin = dec2bin1 sg -- and convert to binary

---------adding to string neccesery 0`s
sg_bin_str = sg_bin as string --convert binary smoothing groups to string
while sg_bin_str.count <= 31 do sg_bin_str = "0" + sg_bin_str


---------2nd poly, the same opertaions
sg2 = polyOp.getFaceSmoothGroup theEP polys[2] --get smoothing groups from poly 2 as decimal
sg_bin2 = dec2bin2 sg2 -- and convert to binary

---------adding to string neccesery 0`s
sg_bin2_str = sg_bin2 as string  --convert binary smoothing groups to string
while sg_bin2_str.count <= 31 do sg_bin2_str = "0" + sg_bin2_str

--sg_bin_str
--sg_bin2_str

---------making 2 bit arrays from strings
for v = 1 to 32 do
(
if sg_bin_str[v] == "1" then sg_bin_array[v] = true else sg_bin_array[v] = false
if sg_bin2_str[v] == "1" then sg_bin2_array[v] = true else sg_bin2_array[v] = false
)

--------comparison of 2 polys by having the same smoothing groups or not
sg_bin_dif_array = #{}
sg_bin_dif_array = sg_bin_array * sg_bin2_array
hardness = false

--exclude polys with the same normal meens it havn't hard edge visible
nor1 = polyOp.getFaceNormal theEP polys[1] --find poly's normals
nor2 = polyOp.getFaceNormal theEP polys[2]

nor1.x = abs (nor1.x * 10000000) as integer
nor1.y = abs (nor1.y * 10000000) as integer
nor1.z = abs (nor1.z * 10000000) as integer

nor2.x = abs (nor2.x * 10000000) as integer
nor2.y = abs (nor2.y * 10000000) as integer
nor2.z = abs (nor2.z * 10000000) as integer

for n = 1 to sg_bin_dif_array.count do
if sg_bin_dif_array[n] != true then hardness = true
else
(
hardness = false
exit
)

if hardness == true then
if nor1 != nor2 then append  HardEdgesArray edgeSelArray[J]
--if hardness == true then append  HardEdgesArray edgeSelArray[J]
-- break()

)-- GLOBAL LOOP END

polyOp.setEdgeSelection theEp HardEdgesArray --Selecting all hard edges
polyOp.SplitEdges theEP HardEdgesArray

Just create a new script, copy this into it, and run it.

BE AWARE. on the front of your nacelles, in those little square cutouts, you have some duplicate verts.
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline Centurus

  • Old Mad Man Making Ship Again....Kinda?
  • Captain
  • *
  • Posts: 8505
  • Gender: Male
Re: Porting problem...
« Reply #26 on: June 28, 2010, 09:48:52 pm »
Odd, I had spent over 2 hours on the nacelle cutouts to make sure there were no duplicate verts.  I'll double check, but I'm positive there aren't duplicate verts.
The pen is truly mightier than the sword.  And considerably easier to write with.

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: Porting problem...
« Reply #27 on: June 28, 2010, 09:55:48 pm »


There should only be 6 edges here, yet I have 12 selected. It is like that on each cutout. If you scale the model to be pretty big, reset the transform, then do a really small weld with all verts selected, thats a pretty sure way to get rid of any duplicate verts, but there is always the potential for a screwup, naturally.
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline Centurus

  • Old Mad Man Making Ship Again....Kinda?
  • Captain
  • *
  • Posts: 8505
  • Gender: Male
Re: Porting problem...
« Reply #28 on: June 28, 2010, 10:35:27 pm »
Must not have saved it the last time.  I fixed it now.
The pen is truly mightier than the sword.  And considerably easier to write with.

Offline Centurus

  • Old Mad Man Making Ship Again....Kinda?
  • Captain
  • *
  • Posts: 8505
  • Gender: Male
Re: Porting problem...
« Reply #29 on: June 29, 2010, 12:08:31 am »
I went over the entire mesh again, double checking all verts.  As far as I can tell, no duplicates.  However, even that new script isn't working.  Keeps generating the same kind of errors, but on different lines.  Why, I don't know.

Also, I can't seem to open the BFF file in MAX 5.
The pen is truly mightier than the sword.  And considerably easier to write with.

Offline Centurus

  • Old Mad Man Making Ship Again....Kinda?
  • Captain
  • *
  • Posts: 8505
  • Gender: Male
Re: Porting problem...
« Reply #30 on: June 29, 2010, 12:15:31 am »
This is what I get when I try and run the script in MAX 5.
The pen is truly mightier than the sword.  And considerably easier to write with.

Offline Centurus

  • Old Mad Man Making Ship Again....Kinda?
  • Captain
  • *
  • Posts: 8505
  • Gender: Male
Re: Porting problem...
« Reply #31 on: June 29, 2010, 12:31:06 am »
Ok, got it imported, but no dice.  The model is still splitting itself apart at the seems, making duplicate verts.  For example, on the rim of the saucer, where there would normally only be 2 verts, there are now 4.

I don't know why this is happening.
The pen is truly mightier than the sword.  And considerably easier to write with.

Offline Centurus

  • Old Mad Man Making Ship Again....Kinda?
  • Captain
  • *
  • Posts: 8505
  • Gender: Male
Re: Porting problem...
« Reply #32 on: June 29, 2010, 01:39:01 am »
Ok, unless I'm a unique case, I think I might have figured it out.  I decided to look at a few models made by other people, namely WZ and FoaS, cause theirs were the most readily available on my computer, and I discovered something.

While concentrating on one edge of the saucer of the ships from both respective modelers, I'm noticing duplicate verts as well, in the same manner as my Demphir, which by the way, the smoothing is intact now in SFC format.

I'm thinking maybe this is how the models are supposed to be.
The pen is truly mightier than the sword.  And considerably easier to write with.

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: Porting problem...
« Reply #33 on: June 29, 2010, 12:28:08 pm »
Don't use grouping what so ever. Just don't use it. I imagine this is why you are getting the error in BFF as well as the split smoothing scripts. Better to attach a model into a single editable poly. I don't know why they still implement it in max, but it screws with everything. Re-export the scene using BFF After you've ungrouped the mesh. It should reimport now.

Split mesh is duplicating verts on edges that are non-smoothed. This is because if you were to use a totally welded model, SFC will smooth the entire thing and ignore your smoothing groups.
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline Centurus

  • Old Mad Man Making Ship Again....Kinda?
  • Captain
  • *
  • Posts: 8505
  • Gender: Male
Re: Porting problem...
« Reply #34 on: June 29, 2010, 01:24:10 pm »
Don't use grouping what so ever. Just don't use it. I imagine this is why you are getting the error in BFF as well as the split smoothing scripts. Better to attach a model into a single editable poly. I don't know why they still implement it in max, but it screws with everything. Re-export the scene using BFF After you've ungrouped the mesh. It should reimport now.

Split mesh is duplicating verts on edges that are non-smoothed. This is because if you were to use a totally welded model, SFC will smooth the entire thing and ignore your smoothing groups.

I realized grouping was causing a few problems, so in my last few attempts I've ungrouped the components.  However, even without the groups, and the entire mesh joined as a single object, I still get the script errors.
The pen is truly mightier than the sword.  And considerably easier to write with.