Can't chage the wireframe name and output - render

I am using the Corona to render and I made a program to automate multiple renders. When run the script, the program generates a .jpeg of the asset with the material and texture and a wireframe image. The problem is that the wireframe don't have his name updated on each image and is not being saved inside the folder that the user selects.
rendSaveFile = true
_frame = 0
studioFile = getOpenFileName caption: "Select the Studio Asset"
loadMaxFile studioFile
directoryParent = getSavePath caption: "Select the Parent Directory"
dirPath = directoryParent + "\*"
dirList = getDirectories dirPath
print dirList
renderPath = getSavePath caption: "Select a Folder to Save the Renders"
for dir in dirList do(
assetsPath = dir + "\*.max"
assetsList = getFiles assetsPath
print assetsList
for current in assetsList do(
xrefs.addNewXRefFile current
currentName = getFilenameFile current
makeDir (renderPath + "\\" + currentName)
finalPath = (renderPath + "\\" + currentName)
for c in cameras where classof c != Targetobject do(
render camera:c outputfile:(finalPath + "\\" + currentName + "_" + c.name + "_" + ".jpeg")
if c.name == "CAM_RENDER_TURN" then(
makeDir (finalPath + "\\" + "360")
turnPath = (finalPath + "\\" + "360")
render camera:c fromframe:0 toframe:10 outputfile:(turnPath + "\\" + currentName + "_" + _frame as string + ".jpeg")
_frame += 1
)
)
xrefs.deleteAllXRefs()
)
)

Related

Adding multiple times together

I'm trying to add some data that is pulled from a database in the format of HH:MM:SS I'm trying to get them to add together so if we have 00:00:05 then 00:00:10 so we have 00:00:15
I have attempted both TimeSpan, DateTime but I get the following error:
Microsoft VBScript runtime error '800a01a8'
Object required: 'TimeSpan'
Script Location, line 157
This is the code:
While Not objRS.EOF
activecalls = activecalls + objRS("talkingagents")
callswaiting = callswaiting + objRS("callswaiting")
averagetalkingtime = averagetalkingtime + objRS("convavgtalkduration")
totalqueue = totalqueue + 1
totalcalls = totalcalls + objRS("totalcalls")
newWait = objRS("convavgwaitduration")
TimeSpan t1 = TimeSpan.Parse(newWait)
TimeString FormattedDate = t1.Add(FormattedDate)
timeString = timeString.Add(t1).ToString("dd\.hh\:mm\:ss")
Not clear with your code but this probably what you are looking for.
t1 = CDate("00:00:05")
t2 = CDate("00:00:10")
t3 = t1 + t2
MsgBox Right("00" & Hour(t3), 2) + ":" + Right("00" & Minute(t3), 2) + ":" + Right("00" & Second(t3), 2)

os.rename not changing file extension in windows

I have a simple Python 3's script that rename all files in a folder, in the shell it shows the new name applied correctly, but when I go to the folder in windows, the files does not have any extension.
i.e: In python I rename somefile to: "newname.jpg", but on windows it is only "newname", without extension. I guess this is more a Windows 10's problem than a Python's problem.
This is the code:
import os
from os import listdir
i = 0
dir = "./PHOTO GALLERY 1"
for archivo in listdir(dir):
i=i+1
if i<10:
j="0"+str(i)
else:
j=str(i)
print ("Nombre original: " + archivo)
os.rename(dir + "/" + archivo, dir + "/" + "photogallery1_" + j)
print ("Nombre nuevo: " + "photogallery1_" + j + ".jpg")
It looks like you're leaving off the file extension:
os.rename(dir + "/" + archivo, dir + "/" + "photogallery1_" + j)
should be
os.rename(dir + "/" + archivo, dir + "/" + "photogallery1_" + j + ".jpg")
like in your print statement.

IE8 error when using property name on an object

var timer = {display:'x', at:'12/23/2016', in : 3000000};
var text = timer.display + " on " + timer.at + ". Time Remaining : " + timer.in;
throws error in IE8 "Expected identifier, string or number"
var text = timer.display + " on " + timer.at + ". Time Remaining : " + timer['in']; works!!!
This works fine in chrome, is .in a keyword and why only IE8 behaving weird?
Isn't in considered as a keyword? You could use:
var timer = {"display":"x", "at":"12/23/2016", "in" : "3000000"};
var text = timer.display + " on " + timer.at + ". Time Remaining : " + timer["in"];
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords

Parameters in Crystal Reports from Visual Studio 2010

My report donĀ“t accept the parameter.
I have created a parameter with "City" name.
In my code i want to full it:
ReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Server.MapPath("CrystalReport.rpt"));
crystalReport.SetParameterValue("City", lblCiudad.Text);
viewer.ReportSource = crystalReport;
the problem is that the report doesnt filter with my parameter, show without it.
Solution with formula:
crystalReportViewer.SelectionFormula = "{Clientes.Nombre} = '" + nombreCliente + "' AND {Registros.Host} = '" + host + "' AND {Registros.Servicio} = '" + service + "' AND {Registros.Fecha} <= " + "DateTime(" + fF.Year.ToString() + "," + fF.Month.ToString() + "," + fF.Day.ToString() + ","+fF.Hour.ToString() + "," + fF.Minute.ToString()+","+fF.Second.ToString()+") AND {Registros.Fecha} >= " + " DateTime(" + fI.Year.ToString() + "," + fI.Month.ToString() + "," + fI.Day.ToString() + ","+fI.Hour.ToString() + "," + fI.Minute.ToString()+","+fI.Second.ToString()+")";

How to use VBScript in Powerdesigner?

In Powerdesign would like to create a VBscript to rename/reform the following names in powerdesigner- Conceptural or Physical model
Alternative/Unique Key Name:
UQ {table_name} {tablecolumnname} ///////
Example = UQ_Account_AccountNumber
Relationship Name:
FK_{table_name}_{reference_table_name}_{reference_column_name}
//////Example = FK_Account_AccountPhone_HomePhoneID
Problem is, how do I get the "table_column_name" and "reference_column_name"?
Here's something I used to rename the 'friendly' names, plus the constraint names of all my references. Maybe it will help you out.
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
Dim mdl
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model"
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not a Physical Data model."
Else
ProcessFolder mdl
End If
Private sub ProcessFolder(folder)
Dim Tab, Key, Rel
for each Rel in Folder.References
Rel.ForeignKeyConstraintName = "FK_" + UCASE(Rel.ParentTable.Name) + "_" + UCASE(Rel.ParentKeyColumnList) + "_" + UCASE(Rel.ChildTable.Name) + "_" + UCASE(Rel.ForeignKeyColumnList)
Rel.Name = "FK_" + UCASE(Rel.ParentTable.Name) + "_" + UCASE(Rel.ParentKeyColumnList) + "_" + UCASE(Rel.ChildTable.Name) + "_" + UCASE(Rel.ForeignKeyColumnList)
next
end sub

Resources