Voici un plug gratuit et pratique pour exporter vers UVL et réimporter
http://resonic.ru/uvlayout-c4d-exchage-plugin/
Math
enorme !! dommage il n'est que pour PC..
kenavo !! // Pinterest KAMIGAZ®
C'est juste un script python, du coup c'est les .exe dans le script qu'il faut modifier non ? Si un codeur passe par la
# Copyright (C) 2016 resonic.ru
#
# File: UVLExport.py
# Last Modified: 01.07.2016
import subprocess, os
import c4d
from c4d import gui, storage
from c4d import documents, plugins
GROUP_ID1 = 1000
GROUP_ID2 = 1001
GROUP_ID3 = 1002
GROUP_ID4 = 1003
TEXTBOX = 1004
TEXTSTATIC = 1005
BUTTON1 = 1011
BUTTON2 = 1012
BUTTON3 = 1013
BUTTON4 = 1014
COMBO_TYPE = 1020
COMBO_UVS = 1021
SUB_SUBD = 1022
SUB_POLY = 1023
SUB_EDIT = 1024
SUB_NEW = 1025
CHK_WELD = 1030
CHK_CLEAN = 1031
CHK_DETACH = 1032
CHK_GEOM = 1033
CHK_DROP = 1034
SYS_SILENT = 1040
tmp_folder = os.path.join(storage.GeGetC4DPath(c4d.C4D_PATH_PRE FS), "uvlcache")
file_path = ""
args = []
class UVLExport(gui.GeDialog):
def CreateLayout(self):
self.GroupBegin(GROUP_ID1, c4d.BFH_SCALEFIT, 3, 1)
self.GroupBorderNoTitle(c4d.BORDER_ROUND)
self.GroupBorderSpace(10, 10, 10, 10)
self.AddStaticText(TEXTSTATIC, c4d.BFH_LEFT, 80, 10, "UVL Path: ", 0)
self.AddEditText(TEXTBOX, c4d.BFH_SCALEFIT, 50, 10)
self.AddButton(BUTTON4, c4d.BFH_RIGHT, name="...")
self.GroupEnd()
#
self.GroupBegin(GROUP_ID2, c4d.BFH_SCALEFIT, 3, 1)
self.GroupBorderNoTitle(c4d.BORDER_ROUND)
self.GroupBorderSpace(10, 10, 10, 10)
self.AddComboBox(COMBO_TYPE, c4d.BFH_SCALEFIT, 1, 12)
self.AddChild(COMBO_TYPE, SUB_SUBD, "SUBD")
self.AddChild(COMBO_TYPE, SUB_POLY, "POLY")
self.AddComboBox(COMBO_UVS, c4d.BFH_SCALEFIT, 1, 12)
self.AddChild(COMBO_UVS, SUB_EDIT, "EDIT")
self.AddChild(COMBO_UVS, SUB_NEW, "NEW")
self.GroupEnd()
#
self.GroupBegin(GROUP_ID3, c4d.BFH_SCALEFIT, 3, 1)
self.GroupBorderNoTitle(c4d.BORDER_ROUND)
self.GroupBorderSpace(10, 10, 10, 10)
self.AddCheckbox(CHK_WELD, c4d.BFH_SCALEFIT, 1, 1, name="WELD")
self.AddCheckbox(CHK_CLEAN, c4d.BFH_SCALEFIT, 1, 1, name="CLEAN")
self.AddCheckbox(CHK_DETACH, c4d.BFH_SCALEFIT, 1, 1, name="DETACH")
self.AddCheckbox(CHK_GEOM, c4d.BFH_SCALEFIT, 1, 1, name="GEOM")
self.AddCheckbox(CHK_DROP, c4d.BFH_SCALEFIT, 1, 1, name="DROP")
self.AddCheckbox(SYS_SILENT, c4d.BFH_SCALEFIT, 1, 1, name="SILENT")
self.GroupEnd()
#
self.GroupBegin(GROUP_ID3, c4d.BFH_SCALEFIT, 3, 1)
self.GroupBorderNoTitle(c4d.BORDER_ROUND)
self.GroupBorderSpace(10, 10, 10, 10)
self.AddButton(BUTTON1, c4d.BFH_SCALEFIT, name="Exchange")
self.AddButton(BUTTON2, c4d.BFH_SCALEFIT, name="Update")
self.AddButton(BUTTON3, c4d.BFH_SCALEFIT, name="Close")
self.GroupEnd()
return True
def InitValues(self):
self.SetString(TEXTBOX, Reader(tmp_folder))
self.SetInt32(COMBO_TYPE, 1022)
self.SetInt32(COMBO_UVS, 1024)
self.SetBool(SYS_SILENT, True)
self.Enable(BUTTON2, False)
return True
def Command(self, id, msg):
if id == BUTTON1:
if self.GetInt32(COMBO_TYPE) == 1022:
args.append("SUBD")
if self.GetInt32(COMBO_TYPE) == 1023:
args.append("Poly")
if self.GetInt32(COMBO_UVS) == 1024:
args.append("Edit")
if self.GetInt32(COMBO_UVS) == 1025:
args.append("New")
if self.GetBool(CHK_WELD):
args.append("Weld")
if self.GetBool(CHK_CLEAN):
args.append("Clean")
if self.GetBool(CHK_DETACH):
args.append("Detach")
if self.GetBool(CHK_GEOM):
args.append("Geom")
if self.GetBool(CHK_DROP):
args.append("Drop")
if not doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHIL DREN):
gui.MessageDialog("Select the objects!")
else:
KillTask()
uvl_path = self.GetString(TEXTBOX)
OBJExporter()
if file_path:
try:
subprocess.Popen([uvl_path, file_path, "-plugin," + ','.join(args)])
except:
gui.MessageDialog("uvlayout.exe not found")
del args[:]
self.Enable(BUTTON2, True)
self.SetString(BUTTON1, "Reload")
self.SetTimer(1500)
elif id == BUTTON2:
OBJExporter()
self.SetTimer(1500)
elif id == BUTTON3:
CacheDel(tmp_folder)
KillTask()
Reader(tmp_folder, 1)
self.Close()
elif id == BUTTON4:
uvl_path = c4d.storage.LoadDialog(type=c4d.FILESELECTTYPE_ANY THING, title="UVLayout.exe",
flags=c4d.FILESELECT_LOAD)
self.SetString(TEXTBOX,uvl_path)
Reader(tmp_folder, 1)
return True
def Timer(self, msg):
out_file = file_path[:-4] + ".out"
tmp_obj = file_path[:-4] + "_.obj"
if os.path.exists(out_file):
try:
os.remove(tmp_obj)
except:
pass
os.rename(out_file, tmp_obj)
OBJImporter(tmp_obj)
print "Loaded!"
def Reader(path, mode=0):
cfg_path = path + r"\config\config.txt"
if not os.path.exists(path):
os.mkdir(path)
if not os.path.exists(path + r"\config"):
os.mkdir(path + r"\config")
if not os.path.exists(cfg_path) or mode == 1:
f = open(cfg_path, 'w')
if mode == 0:
f.write("C:\Program Files (x86)\headus UVLayout v2 Professional\uvlayout.exe")
else:
f.write(dlg.GetString(TEXTBOX))
f.close()
if os.path.exists(cfg_path):
tmp_file = open(cfg_path, 'r')
txt = tmp_file.read() # .split()
tmp_file.close()
return txt
def CacheDel(path):
subprocess.Popen('cmd /c del /f /q ' + '"' + path + '"', shell=False)
def KillTask():
subprocess.Popen('taskkill /f /im cyeatP.exe', shell=False)
p = subprocess.Popen('taskkill /f /im cysliceP.exe', shell=False)
p.wait()
def OBJExporter():
objects = doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHIL DREN)
doc_temp = c4d.documents.IsolateObjects(doc, objects)
if doc_temp is None:
return
plug = plugins.FindPlugin(1030178, c4d.PLUGINTYPE_SCENESAVER)
if plug is None:
return
global file_path
if dlg.GetBool(SYS_SILENT):
if not os.path.exists(tmp_folder):
os.mkdir(tmp_folder)
file_path = tmp_folder + r"\swp.obj"
else:
file_path = c4d.storage.LoadDialog(title="Save File for OBJ Export", flags=c4d.FILESELECT_SAVE,
force_suffix="obj")
if not file_path:
print "Cancel"
return
op = {}
if plug.Message(c4d.MSG_RETRIEVEPRIVATEDATA, op):
if "imexporter" not in op: return
obj_export = op["imexporter"]
if obj_export is None:
return
unit_scale = c4d.UnitScaleData()
unit_scale.SetUnitScale(1.0, c4d.DOCUMENT_UNIT_CM)
obj_export[c4d.OBJEXPORTOPTIONS_SCALE] = unit_scale
obj_export[c4d.OBJEXPORTOPTIONS_TEXTURECOORDINATES] = True
obj_export[c4d.OBJEXPORTOPTIONS_MATERIAL] = c4d.OBJEXPORTOPTIONS_MATERIAL_MATERIAL
obj_export[c4d.OBJEXPORTOPTIONS_OBJECTS_AS_GROUPS] = True
obj_export[c4d.OBJEXPORTOPTIONS_POINTTRANSFORM_FLIPX] = False
obj_export[c4d.OBJEXPORTOPTIONS_POINTTRANSFORM_FLIPY] = False
obj_export[c4d.OBJEXPORTOPTIONS_POINTTRANSFORM_FLIPZ] = False
obj_export[c4d.OBJEXPORTOPTIONS_POINTTRANSFORM_SWAPYZ] = False
obj_export[c4d.OBJEXPORTOPTIONS_POINTTRANSFORM_SWAPXZ] = False
obj_export[c4d.OBJEXPORTOPTIONS_POINTTRANSFORM_SWAPXY] = False
if c4d.documents.SaveDocument(doc_temp, file_path, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, 1030178):
print "Document successfully exported to:" + file_path
else:
print "Export failed!"
c4d.StatusClear()
def OBJImporter(obj_path):
if obj_path is None: return
tmp_obj = doc.GetObjects()
for i in tmp_obj:
i[c4d.ID_BASEOBJECT_VISIBILITY_EDITOR] = True
i[c4d.ID_BASEOBJECT_VISIBILITY_RENDER] = True
plug = plugins.FindPlugin(1030177, c4d.PLUGINTYPE_SCENELOADER)
if plug is None: return
op = {}
if plug.Message(c4d.MSG_RETRIEVEPRIVATEDATA, op):
if "imexporter" not in op: return
obj_import = op["imexporter"]
if obj_import is None: return
unit_scale = c4d.UnitScaleData()
unit_scale.SetUnitScale(1.0, c4d.DOCUMENT_UNIT_CM)
obj_import[c4d.OBJIMPORTOPTIONS_SCALE] = unit_scale
obj_import[c4d.OBJIMPORTOPTIONS_PHONG_ANGLE_DEFAULT] = 22.5
obj_import[c4d.OBJIMPORTOPTIONS_TEXTURECOORDINATES] = True
obj_import[c4d.OBJIMPORTOPTIONS_SPLITBY] = c4d.OBJIMPORTOPTIONS_SPLITBY_OBJECT
obj_import[c4d.OBJIMPORTOPTIONS_MATERIAL] = c4d.OBJIMPORTOPTIONS_MATERIAL_MTLFILE
obj_import[c4d.OBJIMPORTOPTIONS_POINTTRANSFORM_FLIPX] = False
obj_import[c4d.OBJIMPORTOPTIONS_POINTTRANSFORM_FLIPY] = False
obj_import[c4d.OBJIMPORTOPTIONS_POINTTRANSFORM_FLIPZ] = False
obj_import[c4d.OBJIMPORTOPTIONS_POINTTRANSFORM_SWAPXY] = False
obj_import[c4d.OBJIMPORTOPTIONS_POINTTRANSFORM_SWAPXZ] = False
obj_import[c4d.OBJIMPORTOPTIONS_POINTTRANSFORM_SWAPYZ] = False
c4d.documents.MergeDocument(doc, obj_path, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS, None)
if __name__ == '__main__':
dlg = UVLExport()
dlg.Open(c4d.DLG_TYPE_ASYNC, xpos=-1, ypos=-1, defaultw=250, defaulth=200)
Je n'y connais rien en mac OS, du coup ça me semble l'occass pour moi de songer à avoir une VM mac OS.
Quel est l'OS le plus rependu? Y'a t'il de véritable changement entre chaque?( Par exemple Yosemite et Moutain Lions). C'est comme vista? Windows 7? Windows 10 juste des noms de version récente?
Apres comme tu le dis je pense qu'il suffit juste de revoir les liens des applications et sans doute de changer un peu les fonctions relative à subprocess. Mais rien de bien sorcier en théorie... :p
SDK Specialist
MAXON Computer GmbH
Salut Graphos, félicitations pour ta 3eme année ! :-)
Je dirais que El Capitan est le plus répandu au niveau pro, en tout cas les gars qui sont sur mac autour de moi niveau pro sont tous sur el capitan, pas testé Sierra Beta ( j'ai peur )
kenavo !! // Pinterest KAMIGAZ®
Merci ! Faut que je mette à jour ma signature du coup !!!
Bon bha je serais dispo à partir de la semaine prochaine, donc je regarderais ça prochainement (c'est bien d'être étudiants et d'avoir plein de vacances hahaha )
SDK Specialist
MAXON Computer GmbH
Et bien j'aurais plus galéré que je ne le pensais ^^ (faut dire que je ne connaissais pas du tout mac OS c'est une vrai merde à installer sur une VM :p et les commandes dans le terminal sont un peu différentes de linux/windows m'enfin bon ça fonctionne)
Donc voila le lien.
http://graphos.fr/files/Plugin/UVLayoutExchange.zip
Dans cette version il ne s'agit plus d'un script mais d'un plugin donc à mettre dans le dossier plugin de C4D (bien plus facile à installer/utiliser qu'un script je trouve ^^')
Et bien sur le support de mac.
Normalement tout fonctionne comme sur la version PC (d'après mes tests)
SDK Specialist
MAXON Computer GmbH
Un grand merci Graphos !
Je viens de tester ton plugin avec mon UVLayout Hobby et c'est vraiment un "must have" pour tous ceux qui utilisent UVLayout. Ça fonctionne superbement bien.
"One cross each." (Monty Python, The life of Brian)
C4D 21 - Octane C4D plug - 3 x GTX980, 2 x RTX2070 - Intel i7 6850
Merci Maxime ! Ca marche nickel..
kenavo !! // Pinterest KAMIGAZ®
Gr4ph0s,
Dans le script pour PC les objets sont envoyés avec les normales inversées, je ne sais pas s'il en est de même sur ta version MAC.
Tu n'aurais pas un peu de temps pour regarder.
Merci d'avance.
Dernière modification par kadodonoel ; 07/08/2016 à 20h23.
Juste pour info, pouvez-vous expliquer en deux mots ce que fait le plug ??
merci d'avance !
oz
Oser rêver, et mentir
Le plugin permet d'envoyer ton objet sélectionné directement dans uv layout (un soft d'uv tres austère mais tres efficace !).
Sans que tes a te soucier de sauvegarder. D'exporter ta scène (comme le fait le plugin pour maya) puis de re importer le model avec les uv en un seul click.
Pour les uv je regarderai ça mais je promet rien j'ai jamais regardé réellement les uv en python ^^
Edit : pour les uv sa a l'air possible je fait sa quand jai du temps
Dernière modification par gr4ph0s ; 07/08/2016 à 22h49.
SDK Specialist
MAXON Computer GmbH
ok merci !
Oser rêver, et mentir
N'étant pas sur un ordi ou Uv Layout est installé je ne peux pas tester. Mais c'est inversé de haut en bas? ou de droite à gauche? ou les deux?
Graphos
Looking for a job
https://www.artstation.com/cl3m
Sur un cube elle sont à l'intérieures, soit une rotation de 180°.
L'auteur à mis à jour ça version et donc logiquement je l'ai mis à jour pour mac.
Pour ceux qui sont intéressé (version compatible Win/Mac)
http://graphos.xyz/files/Plugin/UVLE...VLExporter.zip
Dernière modification par gr4ph0s ; 27/05/2017 à 14h34.
SDK Specialist
MAXON Computer GmbH
Merci Graphos
kenavo !! // Pinterest KAMIGAZ®
Merci graphos !
J'ignore pourquoi, cette version ne fonctionne pas chez moi. Peut-être est-ce parce que je suis encore en R17 ?
En tout cas, il m'est impossible de renseigner l'exécutable d'UVLayout. Que ce soit par copier-coller du chemin ou en cliquant sur le bouton de sélection (les points de suspension), rien ne se passe... Je ne vois pas de message d'erreur dans la console.
J'ai essayé en mettant le plugin dans le dossier des préférences > plugins ou dans le dossier plugins du dossier programmes.
Ce n'est pas très grave puisque l'ancienne version fonctionne très bien pour mes besoins. C'est juste pour info.
"One cross each." (Monty Python, The life of Brian)
C4D 21 - Octane C4D plug - 3 x GTX980, 2 x RTX2070 - Intel i7 6850
Je ne sais pas quand tu as dl cette version, mais j'ai corrigé ce problème normalement hier ou avant hier me rappel plus.
Bref retest et si ça ne fonctionne toujours pas je me pencherais dessus.
SDK Specialist
MAXON Computer GmbH
Merci pour ta réponse.
En fait, je l'ai téléchargé il y a une heure ou deux. Aujourd'hui en tout cas.
"One cross each." (Monty Python, The life of Brian)
C4D 21 - Octane C4D plug - 3 x GTX980, 2 x RTX2070 - Intel i7 6850
Problème corrigé tu peux re-télécharger.
Merci pour le retour !
SDK Specialist
MAXON Computer GmbH
Super ! Merci graphos !
"One cross each." (Monty Python, The life of Brian)
C4D 21 - Octane C4D plug - 3 x GTX980, 2 x RTX2070 - Intel i7 6850