Hey Stunton, thanks for the help.
But i cant get it work. Problem is, when i add
" -P GoZ_ExportToBlender.py"
in Goz_Config.txt and i restart zBrush the path to the maya/blender app gets lost. So zBrush finds no Maya/Blender under preferences/goz. If iâm not adding the -P GoZ_ExportToBlender.py to the GoZ_config.txt and i restart maya everything works as usual. GoZ Maya Path is linked to /Applications/Blender_2.57/blender.app like it should.
I changed everything in the GoZ_ExportToBlender.py like you said:
import sys
pathImport = â/Users/Shared/Pixologic/GoZProjectsâ
sys.path.append(â/Users/Shared/Pixologic/GoZApps/Mayaâ)
##### BEGIN GPL LICENSE BLOCK
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
##### END GPL LICENSE BLOCK
import bpy,os,pixoGozFile
from pixoGozFile import importGoZ,exportGoZ
pathApp = pathImport.rsplit(â/â,2)[0]+â/GoZBrushâ
objectList = []
scn = bpy.context.scene
try:
fic = open(pathApp+â/GoZ_ObjectList.txtâ,ârtâ)
line = fic.readline()
while line:
objectList.append(line.strip()+â.GoZâ)
line = fic.readline()
fic.close()
except:
pass
def GoZit():
for obj in scn.objects:
if obj.name == âCubeâ:
scn.objects.unlink(obj)
break
for obj in objectList:
importGoZ(scn,obj)
class INFO_HT_header(bpy.types.Header):
bl_space_type = âINFOâ
def draw(self, context):
layout = self.layout
window = context.window
rd = scn.render
row = layout.row(align=True)
row.template_header()
if context.area.show_menus:
sub = row.row(align=True)
sub.menu(âINFO_MT_fileâ)
sub.menu(âINFO_MT_addâ)
if rd.use_game_engine:
sub.menu(âINFO_MT_gameâ)
else:
sub.menu(âINFO_MT_renderâ)
sub.menu(âINFO_MT_helpâ)
if window.screen.show_fullscreen:
layout.operator(âscreen.back_to_previousâ, icon=âSCREEN_BACKâ, text=âBack to Previousâ)
layout.separator()
else:
layout.template_ID(context.window, âscreenâ, new=âscreen.newâ, unlink=âscreen.deleteâ)
layout.template_ID(context.screen, âsceneâ, new=âscene.newâ, unlink=âscene.deleteâ)
layout.separator()
layout.operator(âscene.gob_exportâ, icon=âMAN_TRANSâ, text=âGoBâ)
layout.separator()
if rd.has_multiple_engines:
layout.prop(rd, âengineâ, text="")
layout.separator()
layout.template_running_jobs()
layout.template_reports_banner()
layout.label(text=scn.statistics())
layout.operator(âwm.window_fullscreen_toggleâ, icon=âFULLSCREEN_ENTERâ, text="")
class GoB_export(bpy.types.Operator):
bl_idname = âscene.gob_exportâ
bl_label = âExport to Zbrushâ
def execute(self,context):
fic = open(pathApp+â/GoZ_ObjectList.txtâ,âwtâ)
for obj in scn.objects:
if obj.type == âMESHâ and obj.select:
bpy.ops.object.mode_set(mode=âOBJECTâ)
exportGoZ(scn,obj,pathImport)
fic.write(pathImport+â/{0}
â.format(obj.name))
fic.close()
os.system(pathApp+â/GoZBrushFromApp.appâ)
unregister()
bpy.ops.wm.quit_blender()
return{âFINISHEDâ}
def register():
bpy.utils.register_class(GoB_export)
bpy.utils.register_class(INFO_HT_header)
GoZit()
def unregister():
import bl_ui
bpy.utils.unregister_class(GoB_export)
bpy.utils.unregister_class(INFO_HT_header)
bpy.utils.register_class(bl_ui.space_info.INFO_HT_header)
if name == âmainâ:
register()
I really dont know whats the problem is. Iâm not an expert in Python.
Greetings