PDA

View Full Version : exporting nulls to modeller



pooby
06-09-2004, 06:04 AM
Does anyone know a way of exporting a bunch of nulls in their correct positions to modeller as a single object possibly using the nulls as points?
Or something else that would do the same thing?

I'm tracking a live scene and end up with the trackers as nulls, and want to create a background using the nulls as reference.

geoff3dnz
06-09-2004, 06:26 AM
Hello there ;)

http://www.m2estudios.com/plugins.html

Scroll down and you'll see 'Nulls to Points.ls'.

Cheers!

pooby
06-09-2004, 07:04 AM
Thanks Geoff..

it worked a treat..

We're all looking forward to you starting work here..

Jakkar
09-18-2004, 10:01 PM
This link is gone!
Haven't been able to find any other plugin that does this.
I am in dire need of building 3d geometry from nulls exported from 3d tracking software. I can't believe this is that difficult. There's got to be a way to do this, correct? Short of attaching a modeler point to all the nulls and then saving transformed (which would take forever).
Please Help!

Cman
09-18-2004, 10:43 PM
duplicated

Cman
09-18-2004, 10:44 PM
-------------------
NullsToPoints Readme

Okay, you are using this at your own risk! I am not responsible for lost or damaged data.
Now that that is out of the way, I have not had any problems, and it seems to work very quickly.

Steps:
1 - Run this NullsToPoints.ls in Layout with your scene that has nulls.

NOTE: After complete, this LScript will CREATE AN LSCRIPT IN THE SAME DRIVE LOCATION AS
THE SCENE FILE. This new LScript will be called <name_of_scene>NTPnts.ls. <name_of_scene> stands
for the name of the scene you ran this lscript with. For example: If you have a scene called
"SceneWithPoints.lws", then there will be an LScript file created in the same directory where
"SceneWithPoints.lws" exists, and it will be called "SceneWithPoints.lsNTPnts.ls". You may rename
this file of course if you wish.

2 - Open Modeler

3 - Remeber, NullsToPoints creates an LScript. I myself keep forgetting, so that is why I keep
writing about it. You must run the newly created LScript in Modeler, and it will create points
for you where the Nulls were position in WORLDSPACE.


IMPORTANT:
I don't know why this is, but I found that after running the point creation LScript in Modeler,
if I hit "a" to "viewall", then the view becomes invisible. I do not know why. The only solution,
I found is to copy/paste the created points, called "points_A" into a new layer, then will be
"points_B", then you must delete "points_A", then copy/paste "points_B" whever ever
you want them. Hope that makes sense. :)
If you figure out why and/or how this can be prevented, please let me know.


Hope this helps people. I know it will help me!

------- SCRIPT BELOW ------------



//-----------------------------------------
// NullsToPoints
//
// This creates an LScript file in the directory the
// Lighwave Layout Scene is located. The file will be named
// after the Scene and appended with NTPnts.ls
// For Example: If your scene is called MultiNulls.lws,
// the new lscript file will be called MultiNulls.lwsNTPnts.ls
// Run LScript file in Modeler and it will
// create points where ever a Null was positioned in Layout.
//

@version 2.2
@warnings
@script generic

nulls;
nullpos;
position;
nullcnt = 0;
i = 0;

generic
{
check = false;
nulls = getfirstitem(MESH);

if(!nulls){
reqbegin("Error");
ctlstring(" ","No Nulls!");
reqpost();
return;
}

curscene = Scene();
scenename = curscene.name;
curplace = curscene.filename;


CurFileName = curplace + "NTPnts.ls";


if(fileexists(CurFileName)){
check = true;
CurFile = File(CurFileName,"r");
CurTempName = curplace + "NTPntsT.ls";
CurTemp = File(curplace + "NTPntsT.ls","w");
count = CurFile.linecount();
for(i = 1; i <= count; i++){
CurFile.line(i);
linecheck = CurFile.read();
CurTemp.writeln(linecheck);
if(linecheck == "editbegin();")
break;
}
CurFile.close();
CurTemp.close();
filedelete(CurFileName);
filerename(CurTempName,CurFileName);
CurFile = File(CurFileName,"a");
}

if(check == false){
CurFile = File(CurFileName, "w");
CurFile.writeln("\/\/ NullsToPoints");
CurFile.writeln("\/\/ This Lscript is designed to find Nulls in a Scene file");
CurFile.writeln("\/\/ and create an object file with points in the Null Positions");
CurFile.writeln("@version 2.2");
CurFile.writeln("@warnings");
CurFile.writeln("@script modeler");
CurFile.writeln("main");
CurFile.writeln("{");
CurFile.writeln("editbegin();");
}


while(nulls != nil){
if(nulls.null){
nullpos = nulls.getPosition(0);
CurFile.write("addpoint(");
CurFile.write(nullpos);
CurFile.writeln(");");
nullcnt++;
}
nulls = nulls.next();
}

CurFile.writeln("editend();");
CurFile.writeln("return;");
CurFile.writeln("}");
CurFile.close();

CurFile = File(CurFileName,"r");
CurTempName = curplace + "NTPntsT.ls";
CurTemp = File(curplace + "NTPntsT.ls","w");

count = CurFile.linecount();
for(i = 1; i <= count; i++){
CurFile.line(i);
linecheck = CurFile.read();
if(strleft(linecheck, 8) == "addpoint"){
LineTmp = parse(" ", linecheck);
NewLine = LineTmp[1] + "," + LineTmp[2] + "," + LineTmp[3];
linecheck = NewLine;
}
CurTemp.writeln(linecheck);
if(linecheck == "}")
break;
}

CurFile.close();
CurTemp.close();
filedelete(CurFileName);
filerename(CurTempName,CurFileName);


reqbegin("Nulls Processed");

c2 = ctlinteger("Total Nulls: ",nullcnt);

return if !reqpost();

reqend();
return;
}


----------------------
Hope that helps.

Jakkar
09-20-2004, 12:57 PM
:D
This indeed does the trick!
Thank you hugely.
I don't understand why Newtek doesn't incorporate this functionality into the base package. I work in a major effects/compositing house in L.A. and building 3d objects from exported tracking software nulls is essential to adding effects to live action plates. Often I am inundated with attacks from Maya and Max users and it is increasingly difficult to defend LightWave when things like this make the workflow harder.
Please Newtek, this should be included.

Keeping the faith...
Dave

Cman
09-20-2004, 05:11 PM
I had done a 3D track and like you I needed to get the points into modeler to help build the geometry.
I don't know if it's possible to write an object file from Layout, or read a LWS file from modeler, but either one might make it better.


Anyway, I'm glad you find it useful.

nixx
09-21-2004, 01:56 AM
You could also try CaptureTracks (Layout) and ConvertTracks (Modeler), from here :

http://www.animatethis.gr/downloads/Lscripts

In Layout, select the nulls you want exported and hit "CaptureTracks". Then go to Modeler and hit "ConvertTracks", that will bring in the last set of nulls captured in Layout.

nick

Muad'dib
09-22-2004, 12:00 AM
Thanks Cman this will definitely come in handy ;)

MrWyatt
09-22-2004, 02:10 AM
I used nulls2points exactlly for tracking data too. I believe it was made for that purpose. being able to build dummy geometry so acurate is sure a bliss. couldnīt have done a lot of scenes tracked with matchmover pro without it.

;)

tyrot
11-05-2009, 05:56 PM
dear cageman-and-wavers

although i sent you a pm ...may be somebody else also need this so i write here..

Do you have that workflow video you posted to CGtalk around 2007? You made it for nulls2points ...

And by the way i wanna also add another question.

0- I m trying to mimic an object tracking effect (face remodelling) and I have moving nulls in my Layout.

1- Ok. I have converted points into triangles in modeler thanks to this thread...

2- Now what to do? I exported new polygon faces with triangles to layout. But I cannot get any strech or anything. I have 10 nulls and all of them moving and stretching. But how im gonna make the same thing to my humble object.

How can i tell to LW that
"dear LW please take the point coordinates from those nulls and apply that on your mesh...yes i know i tried to use parenting but .."point by point parenting" can i do that?"

In the tutorial they use MAYA and everything looks dead easy. Is it possible to make the same thing in LW or that s why you guys started to write CORE...because of craziness of dual program architecture???

Thank you friends...

Best