Hmm… I don’t see code positioning your camera. Do you have any such elsewhere? If not, you might find that your camera is still at (0, 0, 0), and thus inside the model that you’re trying to view.
# Somewhere early on in your code, perhaps towards the top
# of your "World" constructor
base.disableMouse() # Disable the default camera control
# ... later:
base.camera.setPos(0, -5, 0) # Or whatever y-value works
By the way, when posting code, trying using the “code” tags (either via the button labelled “Code” when posting or editing a reply or by simply putting the appropriate tags - [ code ] and [ /code ], minus the spaces within the brackets, I believe - around the relevant text). It should allow you to post code in a monospaced font while preserving indentation, and thus keeping scoping clear and code more legible. For example:
[ code ]
Some indented code
# A comment
[ /code ]
without the spaces within the brackets should become:
Even while I used this, I have tried relocating the camera view on the default, but I would rotate and re-zoom. So I’m unpositive that’s the problem, at all.
I will however, take it into consideration for future usage, so thank you.
About the Code tags, I remember using something like it way back on the smaller game programming using GScript, Called HTML tags, so thanks again.
Overall with my code, you don’t happen to see anything wrong with it???
I’m trying to do this, and maybe, just maybe it’s not working because the model for the Actor is misplaced/the file is not loading properly?
So let’s pretend this is the case, and I were to make my own Animations,
How would I import this? Assuming its on my desktop.
All right, I’ve taken another look (including running your code on my end), and, presuming that the code that you’ve posted is the entirety of the project thus far, I see a few problems.
First, I don’t see any code instantiating your “World” class (that is, creating an object of that type), or calling the “run” method, which I believe starts the game. Without the latter, I’d expect the code to run, but produce nothing - not even a window. Is that what you’re seeing?
Second, my version seems to want me to import Actor and DirectStart (the latter provides “base”, I think).
Finally, I am indeed having trouble loading Ralph using just your code; perhaps try the panda model instead:
I don’t see the need to inherit your object from DirectObject since you’re not using any self.accept to accept events.
As Thaumaturge pointed out, you don’t seem to be instantiating your Character class anywhere. Keep in mind that you should store a reference when instantiating it, otherwise it will go out of scope and get garbage collected (which would be responsible for your actor no longer animating).
If you don’t know what that means, I suggest that you go and learn the basic Python concepts first.
Once you’ve done that, try substituting the panda model, using the lines that I gave above, and see what happens - it seems to me to be a quick, simple test, at the least.
Bear in mind that you may still want to move the camera, either by placing it in code or using the built-in camera controls, and that the panda model is enormous, I believe, so you may want to scale it down even more than you are already.
One thing in your solution does concern me, however: your removal of the use of “self”. The effect of that should be to change those variables from instance variables (available anywhere within an instance of the class) to local variables (available only within that scope - in the case of “blaze”, this should be the init method).
That removing “self.” helped implies that there may be a problem elsewhere. If you’d like, perhaps it would help for you to post the entirety of your code (presuming that it’s not too much for a reasonable post).
(I note that in your new code you write “blaze” with its initial letter in lower-case, while previously it was in upper-case, I believe - could it perhaps have been that change that had the positive effect that you’ve seen, rather than the removal of “self.”?)