Skip to content

Instantly share code, notes, and snippets.

@blenderdeluxe
Created November 23, 2023 12:09
Show Gist options
  • Select an option

  • Save blenderdeluxe/ba40050a92942b414b5e385b9db3fcd9 to your computer and use it in GitHub Desktop.

Select an option

Save blenderdeluxe/ba40050a92942b414b5e385b9db3fcd9 to your computer and use it in GitHub Desktop.
global proc updatePhotometricLights(string $filePath) {
// Encuentra todas las luces fotométricas en la escena
string $photometricLights[] = `ls -type "aiPhotometricLight"`;
// Actualiza el atributo 'Photometry File' para cada luz
for ($light in $photometricLights) {
setAttr ($light + ".aiFilename") -type "string" $filePath;
}
}
global proc selectIESFile() {
// Abre un cuadro de diálogo para seleccionar un archivo IES
string $filePaths[] = `fileDialog2 -fileMode 1 -caption "Seleccione el archivo IES" -fileFilter "Archivos IES (*.ies)"`;
// Verifica si se seleccionó un archivo
if (size($filePaths) > 0) {
string $filePath = $filePaths[0];
if ($filePath != "") {
updatePhotometricLights($filePath);
}
}
}
// Crear la interfaz de usuario
global proc createUI() {
// Verificar si la ventana ya existe
if (`window -exists myWindow`) {
deleteUI myWindow;
}
// Crear una nueva ventana
window myWindow;
columnLayout;
button -label "Seleccionar archivo IES" -command "selectIESFile";
button -label "Cerrar" -command "deleteUI myWindow";
showWindow myWindow;
}
// Ejecutar la creación de la interfaz
createUI();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment