Sketchup models

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 sketchup.google.com/3dwarehouse/ … revstart=0

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

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:

                  <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.

Are you sure this is a bug in Sketchup?
A transparency of 0.0 means to me full opacity.

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.

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

<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?

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.

Could you upload a small dae file that doesn’t work somewhere?

Here:
dl.dropbox.com/u/101877937/models.zip

@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.

Thanks for clearifying that :slight_smile:
Through such smalltalk you can really learn useful things sometimes.

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.

Which bug tracker? Panda,Fcollada or Sketchup?

Panda.