Yet Another Blender Egg Exporter (YABEE)

I don’t think that really answers this:
What if you’re exporting multiple object (a whole level), which object will the tag be added to?
If you have to specify the Object name in the custom GUI in the exporter, how is that more convenient? To me clicking an Object and adding tags to its pivate list is nicer and more organized.
And that means you have to click the exporter from the menu, set the tags and exit the exporter GUI if you are done assigning tags but don’t want to export just yet, even if there’s a save button to keep them.

And if you mean have that GUI separately from the exporter, as an operator in the 3d view, then I don’t like that idea either as people will need to learn new stuff just for this exporter, which seems unnecessary, so not worth it.

I don’t know man.

You don’t quite understand, You can add custom properties to any object in the scene. It may be mesh, or vertex, or texture, or whole scene, e.t.c. GUI can be placed together with the Blender native properties.
As for “people will need to learn new stuff just for this exporter”, i was planned to make this properties only for the things relating to the EGG, which not intuitive in the Blender, e.g. tags and collide options.

In short, I try to make an example.

Yeah, I probably don’t understand. I thought you were talking about a single panel for everything.

Either way, I think Blender Properties already map perfectly with Panda tags and collision geometry can be easily represented as tag too, like before.

Very thanks ninth!

redpanda, ok, well, put it off the issue with the custom properties. I’ll try to work on the issues that have accumulated in the googlecode repo.

The script seems to disregard relative texture paths ("//tex.png")

I’m having a problem in exporting an object that uses two materials, and, more to the point, two textures, one in each material. I’m attempting to do this without baking out the textures to a new image.

From what I’ve seen in the egg file, two materials are created as expected, but only one texture is referenced, leaving me with the section of the model to which the first texture was applied appearing correctly, and the other section blank.

Am I perhaps doing something incorrectly? :confused:

I’m using Blender 2.62 and the version linked in the first post of this thread as “rev 11.2 … Blender 2.62” (the file “YABEE_r11_2_b262.zip”), I believe.

redpanda, thanks, i’ll check it.

Thaumaturge, please, upload a test .blend file, which show this bug.

Well, I feel a little silly. ^^;

In putting together such a test blend file, I found my problem: it seems that I hadn’t set the texture map’s coordinate technique to “UV”, leaving it on “Generated”. With that corrected, it seems to export as expected. My apologies for that! ^^;

I expect this version, but with my knowlege of English can be difficult to make detailed instructions to check )

I have offered to write documentation before.

Thanks, but I mean this particular case )

YABEE rev 12.0

  • Some bugfixes.
  • Performance optimization.
  • Option: Apply modifiers.
  • Option: Merge meshes which have Armature modifier with the same skeleton.
  • Option: Run pview after exporting.
  • Collide and ObjectType recognize.

Possible issues:
I used temporary scene copy to make changes before exporting (e.g. modifiers applying),
it’s can cause some issues.

  • Incorrect material exporting on merged meshes.
  • Incomplete scene clearing. Whenever we are deleted our temporary scene,
    Blender won’t to delete other objects, created with the scene, so
    we should do it by hand. I recommend to save the .blend file before
    exporting and reload it after.
  • Names changing.

code.google.com/p/yabee/downloads/list

Nice.
I think you should have a StringProperty to allow to specify Panda’s bin directory manually. Right now the script assumes the Panda executables are added to the PATH, but some versions of Panda had issues adding the path after install.

And we can also have a configuration file to save changes to be reused on next startup.
I have some example code for parsing and writing a configuration file:

# Configuration file syntax:
#
#		for each line:
#			"variableName variableValue"
import os

# defaults
animation_only = False
separate_animation_files = True
tbs_generation = False
tex_processing_mode = False
uv_as_texture = False
copy_texture_files = True
merge_actor = True
apply_modifiers = True
pview = False

def setVariable(var, value):
	varDict = {
		'animation_only': animation_only,
		'separate_animation_files': separate_animation_files,
		'tbs_generation': tbs_generation,
		'tex_processing_mode': tex_processing_mode,
		'uv_as_texture': uv_as_texture,
		'copy_texture_files': copy_texture_files,
		'merge_actor': merge_actor,
		'apply_modifiers': apply_modifiers,
		'pview': pview}
		
	varDict[var] = bool(value)

def parseConfigFile(filename='config.txt'):
	filepath = os.path.dirname(__file__)+'/'+filename
	fileobject = open(filepath, 'r')
	lists = fileobject.readlines()
	
	for i in lists:
		setVariable(i[0], i[1])
	
def writeConfigFile(filename='config.txt', settings=[]):
	"""
	settings - a list of sublists with each having two members:
	the variable name and value
	"""
	filepath = os.path.dirname(__file__)+'/'+filename
	fileobject = open(filepath, 'w')
	
	for i in settings:
		fileobject.write(str(i[0])+' '+str(i[1])+'\n')
	fileobject.close()

def generateConfigFile(filename='config.txt', settings=[['animation_only', False],
		['separate_animation_files', True],
		['tbs_generation', False],
		['tex_processing_mode', False],
		['uv_as_texture', False],
		['copy_texture_files', True],
		['merge_actor', True],
		['apply_modifiers', True],
		['pview', False]]):
	"""
	In case file is missing (deleted), generate a default one
	"""
	writeConfigFile(filename=filename, settings=settings)
	
# create config file if missing
if os.path.isfile(os.path.dirname(__file__)+'/'+'config.txt') == False:
	generateConfigFile()

Or simply use ConfigParser, which comes with python.

Ok, but why so difficult? Why not just use the *.py file with the python dictionary as a config?

So we can reuse it after restarting Blender?

I think ninth meant to store a config file in python syntax along the export script.

ConfigParser is full featured, very simple to use, bundled with python, commonly used (thus having good documentation) and the file format is simple to edit by end users and error tolerant.
It supports sections, substitution and reminds a lot of the good old windows ini files. Example:

[paths]
panda_path = /opt/panda3d
bin_path = %(panda_path)/bin
# comment 1
; another comment
[animation]
animations_separate : true # yes, ":" can be used too!

With a python file you can basically do anything from crashing the program (one commata too much and you get a syntax error) to starting arbitary applications.

Sorry if this is a dumb question, but is it possible to export the whole scene so I can use Blender as a level editor? I can only ever seem to export an individual model.

Thanks,

Adam

Edit: Oh sorry, it is as simple as selecting all of the objects to export. For some reason I thought I’d tried this already but I’m just starting to learn Blender so had probably done something wrong.

Hi I’m new to Panda3D and blender. How can I add collision tags in blender 2.63a? I cannot find any information on this. Any tutorials freely available?