Go Back   MMO Central Forums > Memory Lane > Disney's Toontown Online > Molder HQ

Notices

Molder HQ Phase files snooping and discussions

Old A Panda3d "helper" Module (and a Mac shortcut script)

Login or Register now to see fewer ads.

 
 
Thread Tools Display Modes
  #1  
Old 05-16-2014, 09:38 PM
QED QED is offline
I'll be in the reading room.
QED's Main Toon Info



Join Date: Dec 2009
Location: The Estate
Posts: 485
QED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner Tooniness
A Panda3D "helper" Module (and a Mac shortcut script)

Spoiler for Updates (Last updated: 07/09/14):

1. 06/29/14: Added support for skelecogs.
2. 06/29/14: Added cog medallions.
3. 06/29/14: Fixed Cold Caller's hand color.
4. 07/01/14: Added sleeve matching.
5. 07/04/14: General code clean-up.
6. 07/05/14: Added support for cog bosses.
7. 07/06/14: Fixed issue with rabbit's muzzle.
8. 07/09/14: Updated sleeve-matching logic.

The goal of this module is to simplify common Panda3D tasks -- specifically creating cogs and toons. I've attempted to accomplish this by significantly reducing the amount of code involved in these tasks. You can get the source here.

A short demonstration can be seen here.

AppleScript to create an application which will activate pview upon double-clicking a .bam file:

Spoiler for Shortcut:

Code:
on open {dropped_item}
	set filePath to the ¬
		dropped_item as text
	set pPath to POSIX path of filePath as text
	tell application "Terminal"
           activate
	   try
	       do script ("/Developer/Tools/Panda3D/pview " & pPath) in window 1
	   on error
		do script ("/Developer/Tools/Panda3D/pview " & pPath)
	   end try
	end tell
end open
To make the application,

1. Open AppleScript Editor and paste the above code.
2. Click "Compile" then export with the file format set as Application.
3. Right-click a .bam file and set "open with" to what ever you named the application (also, check "Always open with").

Last edited by QED; 05-17-2015 at 06:26 PM..
  #2  
Old 05-19-2014, 04:59 PM
Mr. Pie Guy's Avatar
Mr. Pie Guy Mr. Pie Guy is offline
Comfortably numb
Mr. Pie Guy's Main Toon Info



Join Date: Jan 2010
Location: "Tooning" it up
Posts: 1,296
My Mood: Busy
Mr. Pie Guy has the heart of a hobbit!Mr. Pie Guy has the heart of a hobbit!Mr. Pie Guy has the heart of a hobbit!Mr. Pie Guy has the heart of a hobbit!Mr. Pie Guy has the heart of a hobbit!Mr. Pie Guy has the heart of a hobbit!Mr. Pie Guy has the heart of a hobbit!Mr. Pie Guy has the heart of a hobbit!Mr. Pie Guy has the heart of a hobbit!Mr. Pie Guy has the heart of a hobbit!Mr. Pie Guy has the heart of a hobbit!
This looks very helpful, thanks for contributing something like this!
  #3  
Old 06-23-2014, 08:26 AM
mojy1234's Avatar
mojy1234 mojy1234 is offline
Loves rotten Cheese
mojy1234's Main Toon Info



Join Date: Dec 2008
Location: Stinking LOM
Posts: 351
My Mood: Roflol
mojy1234 helps all the newbs!mojy1234 helps all the newbs!mojy1234 helps all the newbs!
Thank you!
  #4  
Old 06-24-2014, 05:31 AM
MidnightMoons's Avatar
MidnightMoons MidnightMoons is offline
People are amazing.
MidnightMoons's Main Toon Info



Join Date: Feb 2014
Location: Going "rawr" in the night
Posts: 140
My Mood: Amazed
MidnightMoons will soon be Dungeon Master!MidnightMoons will soon be Dungeon Master!
Hi QED,

I understand your pain in creating Cogs and how tedious of a task it can be, so I wanted to let you in a little secret. You should use dictionaries to create Cogs instead of manually coding them in, it's not only efficient, it saves lots of time, and allows you to easily edit each Cog without much work.

Take a look at this simple example:

Code:
cogs = {'Robber Baron' : {'Name' : 'Robber Baron', 'Type' : 'Cashbot', 'Head' : 'yesman'}}
With that you could create a function to do the rest. So, you could add a new key to the Robber Baron dictionary, 'Suit', with 'suitA', then all you'd need to do in the head declaration is:

Code:
head = loader.loadModel('assets/%s-mod.bam' % (cog['Suit')).find("**/%s" % (cog['Head'])
The 'cog' variable is would be set to cogs['Robber Baron']. If you use this code remember, that unlike lists, you cannot use an integer to get a value, so I couldn't do cogs[0] to get Robber Baron, instead you would iterate through the cogs dictionary to find what you need.

For the animation dictionary:

You could do something similar to the Cog setup and you would include some animations you want to toon to have in the Toon constructor and update the animation dictionary like so:

Code:
self.animations[key] = anim
Hope this helps!
  #5  
Old 06-24-2014, 07:23 AM
mojy1234's Avatar
mojy1234 mojy1234 is offline
Loves rotten Cheese
mojy1234's Main Toon Info



Join Date: Dec 2008
Location: Stinking LOM
Posts: 351
My Mood: Roflol
mojy1234 helps all the newbs!mojy1234 helps all the newbs!mojy1234 helps all the newbs!
I get an error, something along the lines of "loader is undefined" for the blazer line in helper.py
  #6  
Old 06-24-2014, 03:07 PM
QED QED is offline
I'll be in the reading room.
QED's Main Toon Info



Join Date: Dec 2009
Location: The Estate
Posts: 485
QED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner Tooniness
Quote:
Originally Posted by mojy1234 View Post
I get an error, something along the lines of "loader is undefined" for the blazer line in helper.py
I believe the cause of this was a missing import (direct.directbase.DirectStart), which I've since added.

I've also added a function based on MidnightMoons idea, and I've made some corrections to make_cog.

Quote:
Originally Posted by MidnightMoons View Post
Hi QED,

I understand your pain in creating Cogs and how tedious of a task it can be, so I wanted to let you in a little secret. You should use dictionaries to create Cogs instead of manually coding them in, it's not only efficient, it saves lots of time, and allows you to easily edit each Cog without much work.
Thanks for the ideas -- I always appreciate it. However, I don't think we're on the same page. Have you looked at my attached file helper.py?

My goal is not to have to "manually code" a cog (or to have to load components from pre-created dictionaries either, which I think would limit the flexibility of the function) each time; rather, I've created a function to essentially do all the required work -- while still allowing enough flexibility to create custom cogs -- with a single call (as shown in the OP). For instance, here's a script that creates a toon and a cog:

Code:
from helper import Toon, make_cog
import direct.directbase.DirectStart

Hollywood = make_cog('yesman', 'A', 'A', 'sell')
Hollywood.loop('neutral')

My_toon = Toon('Dog', 'm', 'n', 'n', 'm', 's')
My_toon.set_color('coral')
My_toon.set_shirt('phase_4/maps/tt_t_chr_avt_shirt_fishing04.jpg', 'phase_4/maps/tt_t_chr_avt_shirtSleeve_fishing04.jpg')
My_toon.set_bottom('phase_4/maps/tt_t_chr_avt_shorts_golf1.jpg')
My_toon.loop('neutral')
My_toon.setPos(0, 5, 0)

base.oobe()
run()
This is about as efficient as you're going to get.

With that said, however, it would be quite easy to create another function, which calls my make_cog, to accommodate your idea. For instance:

Code:
def load_cog(cog_name):
      cog_dict = {
		'Mr. Hollywood': ('yesman', 'A', 'A', 'sell', '', (7.0 / 6.06)),
		'The Mingler': ('twoface', 'A', 'A', 'sell', 'mingler', (5.75 / 6.06)),
		}

      cog = make_cog(*cog_dict[cog_name][0:5])
      cog.setScale(cog_dict[cog_name][5])
      return cog
Which could then be used like:

Code:
Hollywood = load_cog('Mr. Hollywood')
Hollywood.loop('neutral')

Last edited by QED; 06-24-2014 at 09:02 PM..
  #7  
Old 06-24-2014, 09:55 PM
MidnightMoons's Avatar
MidnightMoons MidnightMoons is offline
People are amazing.
MidnightMoons's Main Toon Info



Join Date: Feb 2014
Location: Going "rawr" in the night
Posts: 140
My Mood: Amazed
MidnightMoons will soon be Dungeon Master!MidnightMoons will soon be Dungeon Master!
I understand where you're getting at, but the easiest way is to just use a dictionary, each entry doesn't have to match, and you could easily check if the predefined Cog needs a rescale by checking if a key is in the cog dictionary. My way definitely allows you to create custom Cogs, and with the below code I successfully recreated Roger Dog's molder. You could even use a boss head, such as a VP for your Cog, and Skelecogs works too.

I currently can create a custom cog with this simple dictionary entry:

Code:
Cogs = {
'Molder' : {'Name' : "Roger Dog's Molder", 'Type' : 'Bossbot', 'Head' : phase_12/models/bossbotHQ/mole_cog.bam, 'Suit' : 'A'} 
}
If you would like to iterate through the dictionary use:
Code:
for key, value in Cogs.iteritems():
  #8  
Old 06-24-2014, 10:39 PM
QED QED is offline
I'll be in the reading room.
QED's Main Toon Info



Join Date: Dec 2009
Location: The Estate
Posts: 485
QED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner Tooniness
Quote:
Originally Posted by MidnightMoons View Post
I understand where you're getting at, but the easiest way is to just use a dictionary, each entry doesn't have to match, and you could easily check if the predefined Cog needs a rescale by checking if a key is in the cog dictionary. My way definitely allows you to create custom Cogs, and with the below code I successfully recreated Roger Dog's molder. You could even use a boss head, such as a VP for your Cog, and Skelecogs works too.
Well, as far I as can tell, you're not understanding what I'm doing, but that's fine. There's more than one way to do things (especially with Python), and I'm not attempting to prove my way is the "best" (although, it does require much less code than the traditional methods).

For example, here's a pretty typical way to create a cog:

Code:
from direct.actor.Actor import Actor
import direct.directbase.DirectStart

 
cog = Actor('phase_3.5/models/char/suitA-mod.bam', {'Victory':'phase_4/models/char/suitA-victory.bam'})
cog.loop('Victory')
cog.reparentTo(render)
blazer = loader.loadTexture('phase_3.5/maps/s_blazer.jpg')
cog.findAllMatches('**/torso').setTexture(blazer, 1)
leg = loader.loadTexture('phase_3.5/maps/s_leg.jpg')
cog.findAllMatches('**/legs').setTexture(leg, 1)
sleeve = loader.loadTexture('phase_3.5/maps/s_sleeve.jpg')
cog.findAllMatches('**/arms').setTexture(sleeve, 1)
head = loader.loadModel('phase_4/models/char/suitA-heads.bam').find('**/yesman')
head.reparentTo(cog.find('**/joint_head'))
 
terrain = loader.loadModel('phase_9/models/cogHQ/SellbotHQExterior.bam')
terrain.reparentTo(render)
 
base.oobe()
run()
And here's my (fully functional) equivalent:

Code:
from helper import load_cog
import direct.directbase.DirectStart

cog = load_cog('Mr. Hollywood')
cog.loop('victory')

terrain = loader.loadModel('phase_9/models/cogHQ/SellbotHQExterior.bam')
terrain.reparentTo(render)

base.oobe()
run()
And the difference is even more apparent when working with toons.

That's all I'm getting at here.
  #9  
Old 06-25-2014, 12:32 AM
Hi5TBone Hi5TBone is offline
I am the scout.
Hi5TBone's Main Toon Info



Join Date: Oct 2013
Location: Lost in my memories
Posts: 297
My Mood: Crazy
Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.
Don't be to rain on the parade but...
I don't know how to add customs modules, could someone help me?
I could know how because it sounds like Déjà vu but maybe somethings just not registering in my brain or I forgot.
  #10  
Old 06-25-2014, 12:39 AM
MidnightMoons's Avatar
MidnightMoons MidnightMoons is offline
People are amazing.
MidnightMoons's Main Toon Info



Join Date: Feb 2014
Location: Going "rawr" in the night
Posts: 140
My Mood: Amazed
MidnightMoons will soon be Dungeon Master!MidnightMoons will soon be Dungeon Master!
Quote:
Originally Posted by Hi5TBone View Post
Don't be to rain on the parade but...
I don't know how to add customs modules, could someone help me?
I could know how because it sounds like Déjà vu but maybe somethings just not registering in my brain or I forgot.
Create a new .py file, name it whatever you like and add this into it for Panda3D:

Code:
from direct.showbase.DirectObject import DirectObject

class MYCLASS(DirectObject):
       def __init__(self):
            pass
Then in another file you can call it like so:
Code:
from MYCLASS import *
Star, '*', imports everything, so if you only want certain classes you need to include which class you want, which would be:

Code:
from MYCLASS import MYSECONDCLASS, MYTHIRDCLASS
I hope this helps.
  #11  
Old 06-25-2014, 12:43 AM
MidnightMoons's Avatar
MidnightMoons MidnightMoons is offline
People are amazing.
MidnightMoons's Main Toon Info



Join Date: Feb 2014
Location: Going "rawr" in the night
Posts: 140
My Mood: Amazed
MidnightMoons will soon be Dungeon Master!MidnightMoons will soon be Dungeon Master!
Quote:
Originally Posted by QED View Post
Well, as far I as can tell, you're not understanding what I'm doing, but that's fine. There's more than one way to do things (especially with Python), and I'm not attempting to prove my way is the "best" (although, it does require much less code than the traditional methods).
Ah, I was just trying to help you, by including a much easier and cleaner way to do it, so instead of 36 sets of code for each cog, you have less than 75 lines for all Cogs. If it works for you, do it that way, code the way you want. If you ever want any help for code, let me know, I'll be willing to help you :)
  #12  
Old 06-25-2014, 12:56 AM
Hi5TBone Hi5TBone is offline
I am the scout.
Hi5TBone's Main Toon Info



Join Date: Oct 2013
Location: Lost in my memories
Posts: 297
My Mood: Crazy
Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.
Oh and I forgot...
For the helper.py, I run the .py file and it just says "Press any key to continue".
I'm on my old computer while my laptop is in the shop, but any suggestions?
  #13  
Old 06-25-2014, 01:20 AM
QED QED is offline
I'll be in the reading room.
QED's Main Toon Info



Join Date: Dec 2009
Location: The Estate
Posts: 485
QED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner Tooniness
Quote:
Originally Posted by MidnightMoons View Post
Ah, I was just trying to help you, by including a much easier and cleaner way to do it, so instead of 36 sets of code for each cog, you have less than 75 lines for all Cogs. If it works for you, do it that way, code the way you want. If you ever want any help for code, let me know, I'll be willing to help you :)
Well, I appreciate the sentiment, but I maintain that we're not on the same page. I don't know what "36 sets of code for each cog" means, but it's not relevant to what I'm doing. Regardless, the goal of this thread isn't to debate; I'm simply providing an alternative (a more concise and simpler one, in my opinion) means of doing common Panda3D tasks, and, if you don't like it, don't use it.

Quote:
Originally Posted by Hi5TBone View Post
Oh and I forgot...
For the helper.py, I run the .py file and it just says "Press any key to continue".
I'm on my old computer while my laptop is in the shop, but any suggestions?
It's not supposed to be "run"; it contains functions and a class which are designed to be imported into another file as "aids." I'd recommend that you read through the source -- I've attempted to provide fairly detailed docstrings.

Quote:
Originally Posted by Hi5TBone View Post
Don't be to rain on the parade but...
I don't know how to add customs modules, could someone help me?
I could know how because it sounds like Déjà vu but maybe somethings just not registering in my brain or I forgot.
Are you asking with specific regard to Panda3D, or just in general? Generally, a "module" is just a .py file, which has no specific form. Either way, I think a good starting point would be a Python tutorial (such as this one) or the official documentation.
  #14  
Old 06-25-2014, 02:11 AM
Hi5TBone Hi5TBone is offline
I am the scout.
Hi5TBone's Main Toon Info



Join Date: Oct 2013
Location: Lost in my memories
Posts: 297
My Mood: Crazy
Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.Hi5TBone is famous at conventions.
Quote:
Originally Posted by QED View Post
Well, I appreciate the sentiment, but I maintain that we're not on the same page. I don't know what "36 sets of code for each cog" means, but it's not relevant to what I'm doing. Regardless, the goal of this thread isn't to debate; I'm simply providing an alternative (a more concise and simpler one, in my opinion) means of doing common Panda3D tasks, and, if you don't like it, don't use it.



It's not supposed to be "run"; it contains functions and a class which are designed to be imported into another file as "aids." I'd recommend that you read through the source -- I've attempted to provide fairly detailed docstrings.



Are you asking with specific regard to Panda3D, or just in general? Generally, a "module" is just a .py file, which has no specific form. Either way, I think a good starting point would be a Python tutorial (such as this one) or the official documentation.
Ok I followed the instructions within the source, and I used this code within it:

from helper import load_cog

Hollywood = load_cog('Mr. Hollywood')
Hollywood.loop('landing')

I got a folder called GeneratedAnim and inside it was "A.txt"
Here is what was inside it:
Spoiler for Open at your own risk, AKA Very Long:
(dp0
S'pickpocket'
p1
clibpandaexpress
Filename
p2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-pickpocket.bam'
p3
tp4
Rp5
sS'tray-walk'
p6
g2
(S'/c/Panda3D-1.8.1/models/phase_12/models/char/suitA-tray-walk.bam'
p7
tp8
Rp9
sS'rightsit-hungry'
p10
g2
(S'/c/Panda3D-1.8.1/models/phase_12/models/char/suitA-rightsit-hungry.bam'
p11
tp12
Rp13
sS'flailing'
p14
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-flailing.bam'
p15
tp16
Rp17
sS'squirt-large'
p18
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-squirt-large.bam'
p19
tp20
Rp21
sS'walk'
p22
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-walk.bam'
p23
tp24
Rp25
sS'golf-club-swing'
p26
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-golf-club-swing.bam'
p27
tp28
Rp29
sS'lose-mod'
p30
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-lose-mod.bam'
p31
tp32
Rp33
sS'sit-angry'
p34
g2
(S'/c/Panda3D-1.8.1/models/phase_12/models/char/suitA-sit-angry.bam'
p35
tp36
Rp37
sS'speak'
p38
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-speak.bam'
p39
tp40
Rp41
sS'roll-o-dex'
p42
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-roll-o-dex.bam'
p43
tp44
Rp45
sS'heads'
p46
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-heads.bam'
p47
tp48
Rp49
sS'slip-forward'
p50
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-slip-forward.bam'
p51
tp52
Rp53
sS'sit'
p54
g2
(S'/c/Panda3D-1.8.1/models/phase_12/models/char/suitA-sit.bam'
p55
tp56
Rp57
sS'pie-small'
p58
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-pie-small.bam'
p59
tp60
Rp61
sS'lured'
p62
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-lured.bam'
p63
tp64
Rp65
sS'sit-lose'
p66
g2
(S'/c/Panda3D-1.8.1/models/phase_12/models/char/suitA-sit-lose.bam'
p67
tp68
Rp69
sS'rubber-stamp'
p70
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-rubber-stamp.bam'
p71
tp72
Rp73
sS'smile'
p74
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-smile.bam'
p75
tp76
Rp77
sS'sit-eat-in'
p78
g2
(S'/c/Panda3D-1.8.1/models/phase_12/models/char/suitA-sit-eat-in.bam'
p79
tp80
Rp81
sS'throw-paper'
p82
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-throw-paper.bam'
p83
tp84
Rp85
sS'leftsit-hungry'
p86
g2
(S'/c/Panda3D-1.8.1/models/phase_12/models/char/suitA-leftsit-hungry.bam'
p87
tp88
Rp89
sS'walknreach'
p90
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-walknreach.bam'
p91
tp92
Rp93
sS'rake'
p94
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-rake.bam'
p95
tp96
Rp97
sS'sidestep-right'
p98
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-sidestep-right.bam'
p99
tp100
Rp101
sS'sidestep-left'
p102
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-sidestep-left.bam'
p103
tp104
Rp105
sS'landing'
p106
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-landing.bam'
p107
tp108
Rp109
sS'sit-eat-out'
p110
g2
(S'/c/Panda3D-1.8.1/models/phase_12/models/char/suitA-sit-eat-out.bam'
p111
tp112
Rp113
sS'hypnotize'
p114
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-hypnotize.bam'
p115
tp116
Rp117
sS'neutral'
p118
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-neutral.bam'
p119
tp120
Rp121
sS'magic1'
p122
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-magic1.bam'
p123
tp124
Rp125
sS'magic3'
p126
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-magic3.bam'
p127
tp128
Rp129
sS'magic2'
p130
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-magic2.bam'
p131
tp132
Rp133
sS'throw-object'
p134
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-throw-object.bam'
p135
tp136
Rp137
sS'slip-backward'
p138
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-slip-backward.bam'
p139
tp140
Rp141
sS'mod'
p142
g2
(S'/c/Panda3D-1.8.1/models/phase_3.5/models/char/suitA-mod.bam'
p143
tp144
Rp145
sS'head-textures'
p146
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-head-textures.bam'
p147
tp148
Rp149
sS'soak'
p150
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-soak.bam'
p151
tp152
Rp153
sS'phone'
p154
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-phone.bam'
p155
tp156
Rp157
sS'glower'
p158
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-glower.bam'
p159
tp160
Rp161
sS'drop'
p162
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-drop.bam'
p163
tp164
Rp165
sS'tug-o-war'
p166
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-tug-o-war.bam'
p167
tp168
Rp169
sS'squirt-small'
p170
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-squirt-small.bam'
p171
tp172
Rp173
sS'fingerwag'
p174
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-fingerwag.bam'
p175
tp176
Rp177
sS'sit-eat-loop'
p178
g2
(S'/c/Panda3D-1.8.1/models/phase_12/models/char/suitA-sit-eat-loop.bam'
p179
tp180
Rp181
sS'anvil-drop'
p182
g2
(S'/c/Panda3D-1.8.1/models/phase_5/models/char/suitA-anvil-drop.bam'
p183
tp184
Rp185
sS'victory'
p186
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-victory.bam'
p187
tp188
Rp189
sS'tray-neutral'
p190
g2
(S'/c/Panda3D-1.8.1/models/phase_12/models/char/suitA-tray-neutral.bam'
p191
tp192
Rp193
sS'lose'
p194
g2
(S'/c/Panda3D-1.8.1/models/phase_4/models/char/suitA-lose.bam'
p195
tp196
Rp197
s.

Sorry if I'm bugging you :P
  #15  
Old 06-25-2014, 02:23 AM
QED QED is offline
I'll be in the reading room.
QED's Main Toon Info



Join Date: Dec 2009
Location: The Estate
Posts: 485
QED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner TooninessQED glows with inner Tooniness
Quote:
Originally Posted by Hi5TBone View Post
Ok I followed the instructions within the source, and I used this code within it:

from helper import load_cog

Hollywood = load_cog('Mr. Hollywood')
Hollywood.loop('landing')

I got a folder called GeneratedAnim and inside it was "A.txt"

Sorry if I'm bugging you :P
Is the above all you put? If so, you created the cog, but you didn't do anything with it. The following does the same thing, but also allows you to view the cog within Sellbot HQ:

Code:
from helper import load_cog
import direct.directbase.DirectStart

Hollywood = load_cog('Mr. Hollywood')
Hollywood.loop('landing')

terrain = loader.loadModel('phase_9/models/cogHQ/SellbotHQExterior.bam')
terrain.reparentTo(render)

base.oobe()
run()
The folder "GeneratedAnim" will be comprised of animation dictionaries for the three kinds of cogs ('A', 'B' and 'C') -- that's what the file "A.txt" is (in pickled form). This allows for any cog animation to be accessed within your primary .py file without having to store a dictionary as big as "A.txt" in your source (it also saves you the time of having to manually construct it).
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
iWatchDog ICCS Certified Child Safe Website
MMO Central Forums on Facebook

CCG on Facebook