Sketchup models

Return to Pipeline

Sketchup models

Postby blitzerc264 » Thu Aug 30, 2012 10:11 am

Hi all, i'm new in the world of panda and 3d. I downloaded few models from sketchup gallery and converted them to dae format, but when i tried to load it with pview or with my simple code, nothing happens (gray window) or the program crash.

I'm using panda 1.7.2 and the file is http://sketchup.google.com/3dwarehouse/ ... revstart=0

Code: Select all
from direct.showbase.ShowBase import ShowBase

class MyApp(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
       
        #base.setBackgroundColor(0, 0, 0)
        #self.setBackgroundColor(0,0,0)
       
        self.obj0 = self.loader.loadModel("./models/a6m3.dae")
        self.obj0.reparentTo(self.render)
        self.obj0.setPos(3,7,4)
       
        self.disableMouse()
        self.useDrive()

       
        #print str(loader)

app = MyApp()
app.run()


Thanks in advance
blitzerc264
 
Posts: 4
Joined: Thu Aug 30, 2012 9:56 am

Postby rdb » Fri Aug 31, 2012 4:56 am

Hi, welcome to the forums!

There's a bug in Sketchup that makes everything invisible when exporting to .dae. It hasn't been fixed so far, to my knowledge. To fix this, open your .dae file,
and find something like this:
Code: Select all
                  <transparency>
                     <float>0.000000</float>
                  </transparency>

Change it to 1.0 instead. Alternatively, hand-edit the .egg files
after the conversion to remove the blending settings.
rdb
 
Posts: 8548
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby Nemesis#13 » Fri Aug 31, 2012 5:05 am

Are you sure this is a bug in Sketchup?
A transparency of 0.0 means to me full opacity.
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby rdb » Fri Aug 31, 2012 5:11 am

Read the COLLADA specification. Sketchup exports using the A_ONE opacity mode, which means that a transparency setting of 1.0 is opaque. Panda conforms to the COLLADA specification in how it interprets transparency settings while Sketchup does not, trust me.

That said, it is indeed rather misleading of the COLLADA developers to do it this way, and that surely is what led the Sketchup developers to overlook this issue.
rdb
 
Posts: 8548
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby blitzerc264 » Fri Aug 31, 2012 5:19 am

rdb wrote:Hi, welcome to the forums!

There's a bug in Sketchup that makes everything invisible when exporting to .dae. It hasn't been fixed so far, to my knowledge. To fix this, open your .dae file,
and find something like this:
Code: Select all
                  <transparency>
                     <float>0.000000</float>
                  </transparency>

Change it to 1.0 instead. Alternatively, hand-edit the .egg files
after the conversion to remove the blending settings.


The converted file contains 1 already. I've tried also the conversion to egg with dae2egg but the file only contains few lines.

Code: Select all
<CoordinateSystem> { Z-Up }

<Comment> {
  "dae2egg a6m3.dae"
}
<Group> SketchUp {
  <Group> instance_0 {
    <Transform> {
      <Matrix4> {
        1 0 0 0
        0 0 1 0
        0 -1 0 0
        -268.707 589.576 461.354 1
      }
    }
  }
}
<Table> {
}


I make a simple cube in sketchup and works fine in panda. Where is the problem?
blitzerc264
 
Posts: 4
Joined: Thu Aug 30, 2012 9:56 am

Postby Nemesis#13 » Fri Aug 31, 2012 5:29 am

I see. Then the bug could probably also be the opaque attribute not set to A_ZERO. Comes out the same, I guess…

I just filed a bug report to google.

EDIT: oh. seems this wasn't the problem. Damn.
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby Nemesis#13 » Fri Aug 31, 2012 5:31 am

Could you upload a small dae file that doesn't work somewhere?
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby blitzerc264 » Fri Aug 31, 2012 6:12 am

blitzerc264
 
Posts: 4
Joined: Thu Aug 30, 2012 9:56 am

Postby rdb » Fri Aug 31, 2012 7:22 am

@Nemesis: A_ZERO was only added to COLLADA recently, and FCollada doesn't support it. However, I'm reading here that Sketchup 7.1 fixes the problem anyway.

@blitzerc264: seems like I've misjudged the problem. I'll look into it.
rdb
 
Posts: 8548
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby Nemesis#13 » Sat Sep 01, 2012 11:51 am

rdb wrote:@Nemesis: A_ZERO was only added to COLLADA recently, and FCollada doesn't support it. However, I'm reading here that Sketchup 7.1 fixes the problem anyway.

Thanks for clearifying that :-)
Through such smalltalk you can really learn useful things sometimes.
User avatar
Nemesis#13
 
Posts: 1041
Joined: Mon Aug 04, 2008 8:09 pm
Location: Germany

Postby rdb » Tue Sep 04, 2012 2:30 pm

I've looked into the original issue, but it seems to have something to do with the way FCollada processes node instances. Because the file is still non-compliant in various ways (particularly the order in which the libraries and nodes are specified), I'm not sure if there's much I can do at the moment. If you don't want the issue to be forgotten, please file a bug report at the bug tracker.
rdb
 
Posts: 8548
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby blitzerc264 » Fri Sep 07, 2012 7:20 am

Which bug tracker? Panda,Fcollada or Sketchup?
blitzerc264
 
Posts: 4
Joined: Thu Aug 30, 2012 9:56 am

Postby rdb » Fri Sep 07, 2012 1:13 pm

Panda.
rdb
 
Posts: 8548
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands


Return to Pipeline

Who is online

Users browsing this forum: No registered users and 0 guests