Ejemplo n.º 1
0
def update_RegistryInfo():
    d = {}
    d['EXPORT_DIR'] = EXPORT_DIR
    d['ONLY_SELECTED'] = ONLY_SELECTED
    d['tooltips'] = tooltips
    d['GLOBAL_COORDS'] = GLOBAL_COORDS
    Registry.SetKey(REG_KEY, d, True)
Ejemplo n.º 2
0
 def save(self):
     """Save settings to registry.
     """
     ExportSettings.save(self)
     settingsDict = {}
     for prop in self._properties:
         settingsDict[prop] = getattr(self, prop)
     Registry.SetKey('b2rex_char', settingsDict, True) 
     return
Ejemplo n.º 3
0
def SavePrefs():
    export_config["persist_server"] = persist_server
    export_config["mesh_format"] = mesh_format
    export_config["window_width"] = window_width
    export_config["window_height"] = window_height
    export_config["fullscreen"] = fullscreen
    export_config["renderpath"] = renderpath
    export_config["group"] = group
    export_config["aa"] = aa
    Registry.SetKey("n2exportconfig", export_config, True)
Ejemplo n.º 4
0
def update_registry():
    d = {
        'EXPORT_MATERIALS': EXPORT_MATERIALS,
        'OUTPUT_LANGUAGE': OUTPUT_LANGUAGE,
        'USE_TWOSIDED_FLAG': USE_TWOSIDED_FLAG,
        'EXPORT_CAMERA': EXPORT_CAMERA,
        'STANDALONE': STANDALONE,
        'SPE_LINE_COLOR': SPE_LINE_COLOR,
        'ONLY_PROPERTIES': ONLY_PROPERTIES,
        'EXPORT_GROUPS': EXPORT_GROUPS,
    }
    Registry.SetKey(REG_KEY, d, True)
Ejemplo n.º 5
0
    def update(self):  # update original key
        global DISK_UPDATE

        data = self.data
        odata = self.origdata
        new = self.sorteddata
        for vartype in new.keys():
            for i in new[vartype]:
                if data[i[0]] != i[1]: data[i[0]] = i[1]
                if odata[i[0]] != i[1]: odata[i[0]] = i[1]

        if DISK_UPDATE: Registry.SetKey(self.key, odata, True)
Ejemplo n.º 6
0
def writeDataToRegistry():
    """
	Writes data to the Blender registry.
	"""

    global G

    dict = {}
    dict['coordmap'] = G.coordmap
    if G.imagename is not None:
        dict['imagename'] = G.imagename

    Registry.SetKey('TsaiCC', dict)
Ejemplo n.º 7
0
def SaveConfig():
    global config_data
    file2 = n2.lookup("/sys/servers/file2")
    #file2.setassign("home", str(config_data["home"]))
    #file2.setassign("proj", str(config_data["proj"]))
    for data in config_data:
        #if(data != "home"):
        data = str(data)
        assign = config_data[data]
        file2.setassign(data, assign)
    texture_dir = file2.manglepath("textures:")
    texture_dir = os.path.abspath(texture_dir)
    texture_dir = string.replace(texture_dir, "\\", "/")
    config_data["texture_dir"] = texture_dir
    Registry.SetKey(reg_name, config_data, True)
Ejemplo n.º 8
0
def update_RegistryInfo():
	d = {}
	d['SKIP_DATA'] = SKIP_DATA
	d['MIRCOL_AS_AMB'] = MIRCOL_AS_AMB
	d['MIRCOL_AS_EMIS'] = MIRCOL_AS_EMIS
	d['ADD_DEFAULT_MAT'] = ADD_DEFAULT_MAT
	d['SET_TEX_DIR'] = SET_TEX_DIR
	d['TEX_DIR'] = TEX_DIR
	d['AC3D_4'] = AC3D_4
	d['NO_SPLIT'] = NO_SPLIT
	d['EXPORT_DIR'] = EXPORT_DIR
	d['ONLY_SELECTED'] = ONLY_SELECTED
	d['PER_FACE_1_OR_2_SIDED'] = PER_FACE_1_OR_2_SIDED
	d['tooltips'] = tooltips
	d['GLOBAL_COORDS'] = GLOBAL_COORDS
	Registry.SetKey(REG_KEY, d, True)
Ejemplo n.º 9
0
 def fCheck(dummy):
     self.msg = []
     if self.bBinPathAuto.val:
         bin = ''
     else:
         bin = self.bBinPath.val
     self.error = CheckPath(bin, self.msg)
     if self.error is False:
         d = {}
         if self.bBinPathManual.val:
             d['PandaBinPath'] = bin
         else:
             d['PandaBinPath'] = ''
         Registry.SetKey('Chicken', d, True)
     else:
         Draw.PupMenu('Configuration Errors%t|' + '|'.join(self.msg))
         print self.msg
Ejemplo n.º 10
0
 def save(self):
     """Save settings to registry.
     """
     settingsDict = {}
     for prop in self.properties:
         settingsDict[prop] = getattr(self, prop)
     if self.username and self.password:
         self.credentials.set_credentials(self.server_url, self.username,
                                          self.password)
     settingsDict['locX'] = self.locX.getValue()
     settingsDict['locY'] = self.locY.getValue()
     settingsDict['locZ'] = self.locZ.getValue()
     for prop in ['Objects', 'Textures', 'Materials', 'Meshes']:
         keyName = 'regen' + prop
         settingsDict[keyName] = getattr(self, keyName)
     Registry.SetKey('b2rex', settingsDict, True)
     return
Ejemplo n.º 11
0
def registry_update():
	global KEX_FILE
	global ENABLE_KEX
	global ENABLE_SUP
	global ENABLE_BETA

	d = {
		'KEX_FILE': KEX_FILE,
		'ENABLE_KEX': ENABLE_KEX,
		'ENABLE_SUP': ENABLE_SUP,
		'ENABLE_BETA': ENABLE_BETA,
		'script': 'export_3ds2kex.py',
		'tooltips': {
			'KEX_FILE': 'Location of 3DS2KEX.exe utility.',
			'ENABLE_KEX': 'Enable creation of KEX by calling 3DS2KEX utility.',
			'ENABLE_SUP': 'Enable creation of custom SUP file for pivot and NUP parameters.',
			'ENABLE_BETA': 'Enable beta 3ds2kex utility features (Dec 2007 Beta release from Knife Edge)',
		},
	}

	Registry.SetKey('export_3ds2kex', d, True)
Ejemplo n.º 12
0
def save_to_registry():
    d = {}
    d['selection_only'] = export_selection_only.val
    d['rotate_z_to_y'] = export_rotate_z_to_y.val
    d['compressed'] = export_compressed.val
    Registry.SetKey('vrml97_export', d, True)
Ejemplo n.º 13
0
def start():
    if not regdict.has_key('params'):
        regdict['params'] = {}
    #build_armature()
    AvatarBuilder()
    Registry.SetKey('sl_blender', regdict, True)
Ejemplo n.º 14
0
def update_registry():
    global TEXTURES_DIR
    rd = dict([('TEXTURES_DIR', TEXTURES_DIR)])
    Registry.SetKey('acc3d_import', rd, True)
Ejemplo n.º 15
0
def update_registry():
    rd = {}
    for var in CFG_LIST:
        exec("rd['%s']=%s" % (var, var))
    Registry.SetKey(KEY_NAME, rd, True)
Ejemplo n.º 16
0
def update_registry():
	global TEXTURES_DIR, DISPLAY_TRANSP
	rd = dict([('tooltips', tooltips), ('TEXTURES_DIR', TEXTURES_DIR), ('DISPLAY_TRANSP', DISPLAY_TRANSP), ('SUBDIV', SUBDIV)])
	Registry.SetKey('ac3d_import', rd, True)
Ejemplo n.º 17
0
def edit_extern(image=None):

    if not image:
        image = Image.GetCurrent()

    if not image:  # Image is None
        Draw.PupMenu('ERROR: You must select an active Image.')
        return
    if image.packed:
        Draw.PupMenu('ERROR: Image is packed, unpack before editing.')
        return

    imageFileName = sys.expandpath(image.filename)

    if not sys.exists(imageFileName):
        Draw.PupMenu('ERROR: Image path does not exist.')
        return

    pupblock = [imageFileName.split('/')[-1].split('\\')[-1]]

    new_text = False
    try:
        appstring = Registry.GetKey('ExternalImageEditor', True)
        appstring = appstring['path']

        # for ZanQdo if he removed the path from the textbox totaly. ;) - Cam
        if not appstring or appstring.find('%f') == -1:
            new_text = True
    except:
        new_text = True

    if new_text:
        pupblock.append('first time, set path.')
        if platform == 'win32':
            appstring = 'start "" /B "%f"'
        elif platform == 'darwin':
            appstring = 'open "%f"'
        else:
            appstring = 'gimp-remote "%f"'

    appstring_but = Draw.Create(appstring)
    save_default_but = Draw.Create(0)

    pupblock.append(
        ('editor: ', appstring_but, 0, 48,
         'Path to application, %f will be replaced with the image path.'))
    pupblock.append(('Set Default', save_default_but,
                     'Store this path in the blender registry.'))

    # Only configure if Shift is held,
    if Blender.Window.GetKeyQualifiers() & Blender.Window.Qual.SHIFT:
        if not Draw.PupBlock('External Image Editor...', pupblock):
            return

    appstring = appstring_but.val
    save_default = save_default_but.val

    if save_default:
        Registry.SetKey('ExternalImageEditor', {'path': appstring}, True)

    if appstring.find('%f') == -1:
        Draw.PupMenu(
            'ERROR: The comment you entered did not contain the filename ("%f")'
        )
        return

    # -------------------------------

    appstring = appstring.replace('%f', imageFileName)
    print '\tediting image with command "%s"' % appstring
    os.system(appstring)
Ejemplo n.º 18
0
def edit_extern(image=None):
	
	if not image:
		image = Image.GetCurrent()
	
	if not image: # Image is None
		Draw.PupMenu('ERROR: Please select active Image.')
		return
	if image.packed:
		Draw.PupMenu('ERROR: Image is packed, unpack before editing.')
		return
	
	imageFileName = sys.expandpath( image.filename )
	
	if not sys.exists(imageFileName):
		Draw.PupMenu('ERROR: Image path does not exist.')
		return
	
	pupblock = [imageFileName.split('/')[-1].split('\\')[-1]]
	
	new_text= False
	try:
		appstring = Registry.GetKey('ExternalImageEditor', True)
		appstring = appstring['path']
		
		# for ZanQdo if he removed the path from the textbox totaly. ;) - Cam
		if not appstring or appstring.find('%f')==-1:
			new_text= True
	except:
		new_text= True
	
	if new_text:
		pupblock.append('first time, set path.')
		if platform == 'win32':
			# Example of path to popular image editor... ;-)
			# appstring = '"C:\\Program Files\\Adobe\\Photoshop CS\\photoshop.exe" "%f"'
			# Have to add "cmd /c" to make sure we're using Windows shell.
			appstring = 'cmd /c start "" /B "%f"'
		elif platform == 'darwin':
			appstring = 'open "%f"'
		else:
			appstring = 'gimp %f'
	
	appstring_but = Draw.Create(appstring)
	save_default_but = Draw.Create(0)
	
	pupblock.append(('editor: ', appstring_but, 0, 99, 'Path to application, %f will be replaced with the image path.'))
	pupblock.append(('Set Default', save_default_but, 'Store this path in the blender registry.'))
	
	# Only configure if Shift is held,
	if Blender.Window.GetKeyQualifiers() & Blender.Window.Qual.SHIFT:
		if not Draw.PupBlock('External Image Editor...', pupblock):
			return
	
	appstring = appstring_but.val
	save_default= save_default_but.val
	
	if save_default:
		Registry.SetKey('ExternalImageEditor', {'path':appstring}, True)
	
	if appstring.find('%f') == -1:
		Draw.PupMenu('ERROR: No filename specified! ("%f")')
		return
	
	# -------------------------------
	
	os_run(appstring, imageFileName)