Mostrando entradas con la etiqueta Python Script. Mostrar todas las entradas
Mostrando entradas con la etiqueta Python Script. Mostrar todas las entradas

martes, 24 de junio de 2014

[Script] - Auto toggle simplify

Estuve con la necesidad de trabajar en viewport de manera rápida, y ver el render de manera final, evitando apagar cada modifier view manualmente.
Entonces, hice un simple script que hace un toggle del simplify cada vez que soltamos el render.
Es simple pero efectivo!


I made this script for turn off simplify when hit render, and turn on when the render finish.




Image



Para usarlo cargar este texto en el editor de texto, salvarlo como .py. Cargarlo nuevamente de archivo y marcar como "Register".

Save the script in the .blend folder, load in the text editor and hit "Register", save scene and reload.


import bpy

def simplifica(dummy):
    if bpy.context.scene.render.use_simplify == False:
        bpy.context.scene.render.use_simplify = True
    else:
        bpy.context.scene.render.use_simplify =  False    
        
        
        
bpy.app.handlers.render_pre.append(simplifica)   
bpy.app.handlers.render_post.append(simplifica)
 
 

viernes, 21 de junio de 2013

[Blender Script] - Connect Sun with Cycles Sky Texture.

This script connect the sun light with the sky texture node.
You only need run this script in your scene in cycles render engine.
If you haven't  a sun light the script will add a new light.

In other words, the script let you have the sun and the sky in the same direction!



Image


viernes, 27 de abril de 2012

Blender Addon - Random Vertices 1.1

- This addon randomize the location of selected vertices.

- Este add-on desplaza aleatoriamente los vertices seleccionados.






------------------------------------------------------------------
------------------------------------------------------------------




sábado, 21 de enero de 2012

Python Script - Dividir videos con Mencoder en Ubuntu.

Viendo la necesidad de dividir videos pensé en mencoder. Funcionó todo bien hasta que me di cuenta que para dividir los archivos habia que establecer el tiempo de in y out. Hacer esto manualmente no me dio satisfacción, asi que pensé en Python.

Con estas pocas lineas conseguimos su funcionamiento:



import os
## VARIABLES
PATH="/media/WORKS/CURSO_BLENDER_2012/COMODIDAD_RIG/PARTE3"##PATH AL FOLDER
SEG=10 ## CORTE CADA TANTOS SEGUNDOS
PARTS=3 ##CANTIDAD DE PARTES


PARTINC=1 ## NO TOCAR
SS=0## NO TOCAR


##SETEO LOCATION
os.chdir(PATH)
LISTFILES=list(os.listdir(PATH))
for FILE in LISTFILES:
    if FILE.count(".ogg"):
        OGGPATH=FILE        
ENTIREFILE=PATH+"/"+OGGPATH  
for PARTE in range(0,PARTS):
    VARSTRING=str("mencoder -ovc xvid -xvidencopts bitrate=2000:pass=2 -o "+OGGPATH.replace(".ogg","_part"+str(PARTINC)+".avi")+" "+ENTIREFILE+" -ss "+str(SS)+" -endpos "+str(SEG)+" -sub "+OGGPATH.replace(".ogg",".srt"))
    print(VARSTRING) 
    os.system(VARSTRING)
    SS+=SEG
    PARTINC+=1


Un saludo.