Basically, I am experimenting using Panda3D 1.9.2, Python 2.7.12 and pygame 1.9.1, and I'm experimenting by putting together Toontown Rewritten and Disney's Toontown Online assets in an attempt to create something random and see where I can get with it. I am brand new to coding in Python w/ Panda3D & pygame so I'm not sure at all what I am doing wrong. My code is:
from direct.actor.Actor import Actor
from pandac.PandaModules import *
from direct.task import Task
import math
from math import pi, sin, cos
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from direct.interval.IntervalGlobal import Sequence
from pandac.PandaModules import Point3
from pandac.PandaModules import *
from panda3d.core import loadPrcFile
loadPrcFile("config.prc")
import direct.directbase.DirectStart
from panda3d.core import CollisionTraverser,CollisionNode
from panda3d.core import CollisionHandlerQueue,CollisionRay
from panda3d.core import Filename,AmbientLight,DirectionalLight
from panda3d.core import PandaNode, NodePath, Camera, TextNode
from panda3d.core import Vec3,Vec4,BitMask32
from direct.gui.OnscreenText import OnscreenText
from direct.actor.Actor import Actor
from direct.showbase.DirectObject import DirectObject
import pygame
pygame.init()
pygame.mixer.music.load('bgm.ogg')
pygame.mixer.music.play(-1, 0.0)
while pygame.mixer.music.get_busy() == True:
continue
cog = Actor ('phase_3.5/models/char/suitA-mod.bam', {'action':'phase_4/models/char/suitA-neutral.bam'})
cog.loop('action')
cog.reparentTo(render)
cog.find('**/hands').setColor(0.95, 0.75, 0.75, 1.0)
#SELLBOT cog.find('**/hands').setColor(0.95, 0.75, 0.95, 1.0)
#CASHBOT cog.find('**/hands').setColor(0.65, 0.95, 0.85, 1.0)
#LAWBOT cog.find('**/hands').setColor(0.75, 0.75, 0.95, 1.0)
#BOSSBOT cog.find('**/hands').setColor(0.95, 0.75, 0.75, 1.0)
cog.setPos(0, 20, 0)
myTex = loader.loadTexture('phase_3.5/maps/c_blazer.jpg')
cog.findAllMatches('**/torso').setTexture(myTex, 1)
myTex2 = loader.loadTexture('phase_3.5/maps/c_leg.jpg')
cog.findAllMatches('**/legs').setTexture(myTex2, 1)
myTex3 = loader.loadTexture('phase_3.5/maps/c_sleeve.jpg')
cog.findAllMatches('**/arms').setTexture(myTex3, 1)
coghead = loader.loadModel('phase_4/models/char/suitA-heads.bam').find('**/yesman')
coghead.reparentTo(cog.find('**/joint_head'))
camera.hide()
base.oobe()
base.run()
This code just creates this mess: http://prntscr.com/bnvvae
I did not create the entire code, but rather modified someone's example that was posted online. It was only until I implemented the OGG file that it stopped working properly. I must also add that the music file plays perfectly fine, despite the program "not responding".
I'm not sure what I'm doing wrong. Can somebody help me please?