Cursos e Bibliotecas Ver Mais

Galeria 3D1 Ver Mais

An3dre   Araras / SP - SP
dpi3d   Recife - PE
Thiago Peitl   Marília/SP
netiquinho   São José Do Rio Preto - AC
Jefferson   curitiba - PR

Portfólios Ver Mais

Tôkis   São Paulo
Ruben   Santa Isabel - SP
jeferwolff   Rio Negrinho - SC
Ariel Alencar   Dracena - SP

Código de maxscript pra fazer botão.

Por: stenionet  

Em: 29/04/2010 09:16

Peguei esse maxscript: http://www.scriptspot.com/3ds-max/scripts/sweep-profile e estou tentando criar um botão pra ele. Mas está dando erro. Normalmente, eu apenas coloco esse código antes do script: "MacroScript hideLayerByObject category:"Frodo's Magic Bag" category: "Custom" toolTip: "Hide Layer by Object" buttonText: "Hidebyname" Icon:#("AnimLayerToolbar",5)" Esse é o script: if SweepForm!=undefined do SweepForm.Close() ( fn updateSweep shapefile = ( selShapes = for obj in selection collect obj if selShapes.count>0 then( mergeMAXFile shapefile #useSceneMtlDups #mergeDups #select #noRedraw quiet:true format ("Filename: " + (getFileNameFile shapefile) + "\n") newobj = for obj in selection where superclassof obj == shape collect obj newobj = newobj[1] sw = sweep CustomShape:1 PivotAlignment:6 SmoothPath:off MirrorXZPlane:off GenerateMappingCoords:on sw.shapes[1] = newobj for x in selShapes do( objSweepMod = x.modifiers[#Sweep] if objSweepMod !=undefined then ( if objSweepMod.shapes[1]!=undefined do ( SweepShape = for i in refs.dependentNodes objSweepMod.shapes[1] where superclassof i == shape collect i if isValidNode SweepShape[1] do delete SweepShape[1] ) objSweepMod.CustomShape = 1 objSweepMod.shapes[1] = newobj )else if superclassof x == shape do addmodifier x (sw) ) newobj.steps=2 newobj.wirecolor = color 255 255 255 newobj.render_renderable = false newobj.optimize = true newobj.adaptive = false newobj.pos=selShapes[1].pos -- if not keyboard.shiftPressed then delete newobj select selShapes gc light:true ) ) local IniFile = "$UserScripts\TrackScripts\SweepProfile.ini" fn createIniFile = ( newFile = createFile IniFile format "[Preferences]\n" to:newFile format "Location=%\n" [40,40] to:newFile format "Size=%\n" [250,560] to:newFile flush newFile close newFile ) fn SweepFormClose form e = ( setIniSetting IniFile "Preferences" "Location" ([form.Location.x,form.Location.y] as string) setIniSetting IniFile "Preferences" "Size" ([form.width,form.height] as string) (dotnetclass "system.gc").collect() gc light:true ) local maxfiles = getFiles "$UserScripts\TrackScripts\Section\*.max" -- join maxfiles (getFiles "$UserScripts\TrackScripts\Section\Profile\*.max") local AddRange=#() if not doesFileExist IniFile do createIniFile() local Location = execute (getIniSetting IniFile "Preferences" "Location") local Size = execute (getIniSetting IniFile "Preferences" "Size") SweepForm = dotNetObject "MaxCustomControls.MaxForm" SweepForm.Size = dotNetObject "System.Drawing.Size" Size.x Size.y SweepForm.Text = "Sweep Profile v0.6" dotnet.addeventhandler SweepForm "FormClosed" SweepFormClose FLP=dotNetobject "System.Windows.Forms.FlowLayoutPanel" FLP.AutoScroll=true FLP.Dock=FLP.Dock.Fill FLP.ForeColor=FLP.BackColor.White infoLabel = dotNetObject "System.Windows.Forms.Label" infoLabel.TextAlign=infoLabel.TextAlign.MiddleCenter infoLabel.Dock = infoLabel.Dock.Bottom infoLabel.BorderStyle=infoLabel.BorderStyle.FixedSingle fn onClick sender arg = ( -- sender.BackColor =sender.BackColor.Green if sender.Tag != undefined and doesFileExist sender.Tag do( infoLabel.text = (getFilenameFile sender.Tag) updateSweep sender.Tag ) ) for k=1 to maxfiles.count do ( local img = undefined btLabel = dotNetObject "System.Windows.Forms.Label" btLabel.text = (getFilenameFile maxfiles[k]) btLabel.TextAlign=btLabel.TextAlign.BottomCenter -- btLabel.BackColor=(dotnetclass "System.Drawing.Color").fromargb 120 224 224 224 btLabel.BackColor=btLabel.BackColor.White btLabel.ForeColor=btLabel.BackColor.Black btLabel.Dock = btLabel.Dock.Bottom btLabel.Size=dotnetobject "System.Drawing.Size" 50 15 bt = dotNetobject "System.Windows.Forms.Button" bt.FlatStyle=bt.FlatStyle.Flat bt.Size=dotnetobject "System.Drawing.Size" 50 50 case of ( (doesFileExist (img = getFilenamePath maxfiles[k] + getFilenameFile maxfiles[k] + ".bmp")): ( dnImage = (DotNetObject "System.Drawing.Bitmap" img) bt.BackgroundImage = DotNetObject "System.Drawing.Bitmap" dnImage bt.Size dnImage.Dispose() ) ((doesFileExist (img = getFilenamePath maxfiles[k] + getFilenameFile maxfiles[k] + ".jpg"))): ( dnImage = (DotNetObject "System.Drawing.Bitmap" img) bt.BackgroundImage = DotNetObject "System.Drawing.Bitmap" dnImage bt.Size dnImage.Dispose() ) (doesFileExist (img = maxfiles[k] + ".bmp")): ( dnImage = (DotNetObject "System.Drawing.Bitmap" img) bt.BackgroundImage = DotNetObject "System.Drawing.Bitmap" dnImage bt.Size dnImage.Dispose() ) (doesFileExist (img = maxfiles[k] + ".jpg")): ( dnImage = (DotNetObject "System.Drawing.Bitmap" img) bt.BackgroundImage = DotNetObject "System.Drawing.Bitmap" dnImage bt.Size dnImage.Dispose() ) ) bt.Dock = bt.Dock.Top -- bt.text = (getFilenameFile maxfiles[k]) -- bt.TextImageRelation=bt.TextImageRelation.ImageBeforeText -- bt.TextAlign=bt.TextAlign.BottomCenter bt.ImageAlign=bt.ImageAlign.TopCenter bt.Size=dotnetobject "System.Drawing.Size" 50 65 bt.tag = maxfiles[k] bt.Controls.Add btLabel dotnet.addeventhandler bt "Click" onClick append AddRange bt ) FLP.Controls.AddRange AddRange SweepForm.Controls.Add FLP SweepForm.Controls.Add infoLabel SweepForm.StartPosition=SweepForm.StartPosition.Manual SweepForm.Location = dotNetObject "System.Drawing.Point" Location.x Location.y SweepForm.ShowModeless() -- clearListener() ) Alguém pode ajudar? Valeu.
Nada? Acho que o problema é simples pra quem sabe maxscript. :) Pena que eu não sei.
Consegui. Coloquei esse código no início: macroScript SweepProfile_button buttonText:"SweepProfile_button" category:"Custom" tooltip:"SweepProfile_button" icon:#("SubObjectIcons",1) (
Bacana stenio, nunca mexi nos scripts, vou tentar colocar no meu. É só abrir o arquivo do script e colar essa parte no começo do código?
Posso estar falando bobagem, mas não é só ir no customize>configure user interface e arrastar o comando do script para a barra de ícones que cria o botão automaticamente?
Luis Eduardo F Desculpa pela demora. É que não fui notificado que tinha resposta. Acho que é só colar. milton 3d studio max Acho que tem que ter o código para ser criado o botão.

Faça o login para poder comentar

Usuários conectados

Total de mensagens publicadas pelos membros da comunidade: 711311.

Total de membros registrados: 138841

Últimos membros registrados: naturegardencbd, glucofitrecensioner, glucovitforte, ADAILSONSB, eelhoeturmeric, Saundersjohns, Vertigenics, NexagenReviewsAustralia.

Usuário(s) on-line na última hora: 619, sendo 19 membro(s) e 600 visitante(s).

Membro(s) on-line na última hora: jessicatorres, Luan, Le_Andro, Eber.Silva, Starter, glucofitrecensioner, Rodrigosouza3D, MarcioBottega, naturegardencbd, Rodrigo, glucovitforte, RubenX7, Frederico Wagner N. R., JesusEnzo , renaz, jhownicolas, Duda, Elis, Marco Rocha.

Legenda: Administrador, Especial, Moderador, Parceiro .

3D1 © Três D1 © 1999-2025. Todos direitos reservados.