Jump to content
Official BF Editor Forums
Rexman

3dsmax Tool - Download (June 10, 2006)

Recommended Posts

Well, think out of the box :P . If your weapon has a scope or zoomed view, you'd probably need 2 materials: One for the main weapon, one for the scope / ironsight. As weapons normally don't have other specialities, you should get away with one 'ColormapGloss' for the main texture and an 'Alpha' for the scope/zoomed view.

Share this post


Link to post
Share on other sites

I haven't been able to install the tool properly.

I extracted the files from the .zip which gave me a folder called bf2_3dsmax_10June2006 I didn't touch anything inside. cut and pasted it in Autodesk/3dsMax8/ which is my 3dsmax directory. but that was it. it didn't show up in my 3dsmax toolbar.

Share this post


Link to post
Share on other sites

No, you have to drag the folders inside the zip to the /3DSMax/ folder. So /scripts add to your /scripts folder in 3DS, /maps adds to the /maps folder and so on.

Share this post


Link to post
Share on other sites

cool, thanks! I got it to work. I haven't actually imported anything for lightmaps or exported but the tool shows up and

it functions properly when I select the options and all that.

thanks again

Share this post


Link to post
Share on other sites

I'm almost positive I have followed instructions to the letter, plus Bensta was helping me set this up. I can not get lightmapping to work using these tools, the latest version BTW. I am, however, using 3ds max 9. Here is the problem:

Im trying to generate lightmaps for a 2142 map, using a 2142 mod from within the BF2 mod folder of course. I click on import staticobject.con and after a few seconds of loading I get this:

In a box:

--Unknown Property "importMeshFile" is undefined

Then a box behind it:

local rootNode = bf2mdtOps.importMeshFile fname lightmapInt s
--format " importMeshFile() % ms\n" (timeStamp() - timeStartImport)


if not isValidNode rootNode then
(
	return undefined
)



-- Set name of root node
--
local myFileTypeName = "staticmesh"
if classof fileType == string then
(	if fileType.count > 1 then
	(	
		if fileType[1] == "." then myFileTypeName = substring fileType 2 -1
		else myFileTypeName = fileType
	)
)


-- Replace Root Node with a Point object
--
(
	local newRootNode = point name:("root_" + (lowercase myFileTypeName) + "_" + objName)

	-- Transfer children to new node
	local childArray = #()
	for c in rootNode.children do append childArray c
	for c in childArray do c.parent = newRootNode 

	delete rootNode
	rootNode = newRootNode 
)


local prefixTest = (lowercase objName) + "_"


local objMaterial = undefined



-- Set object names and adjust hierarchy to match that of the template
--


local numGeoms = rootNode.children.count
for geomNode in rootNode.children do
(
	--format " %\n" geomNode.name
	local lod = 0
	for lodNode in geomNode.children do
	(
		--format "  %\n" lodNode.name

		local geomPartToTemplateMap = #()
		local nodeChildren = #()
		local nodeNames = #()

		for partNode in lodNode.children do
		(
			if partNode.material != undefined then 
				objMaterial = partNode.material

			local partInx = partNode.name as integer
		--	format "    %\n" partInx

			if forLm == true then
			(
				partNode.wirecolor = white
			)

			for t in templateInfo do
			(
				format "tName: %\n" t

				if t.geometryPart == partInx then
				(

					local tName = lowercase t.name


					if forLm != true then		
					(			
						if findstring tName prefixTest == 1 then
						(
							tName = substring t.name (prefixTest.count + 1) -1
						)

						partNode.name = tName + "__" + t.type
					)
					else
					(
						partNode.name = tName + "=" + (lod as string)
					)


					geomPartToTemplateMap[ partInx + 1 ] = t
					nodeChildren[partInx + 1] = partNode
					nodeNames[partInx + 1] = lowercase t.name


					exit
				)
			)
			lod += 1
		)



		local numParts = nodeChildren.count

		-- setup the hierarchy
		for m=1 to numParts do
		(
			local meshPart = nodeChildren[m]
			if not isValidNode meshPart then
				continue

			local t = geomPartToTemplateMap[m]
			if classof t != bf2ObjectTemplateStruct then
				continue

			for c in t.children do
			(			
				local childFound = false

				local tmpName = lowercase c.name

				for x=1 to numParts do
				(
					if x == m then continue

					if isValidNode nodeChildren[x] then
					(
						if tmpName == nodeNames[x] then
						(
							nodeChildren[x].transform = c.absoluteTransform
							nodeChildren[x].pos = nodeChildren[x].pos * s
							nodeChildren[x].parent = meshPart
							childFound = true

							exit
						)
					)
				) -- loop x

				if childFound == false then
				(
				--	format "     Not found: %\n" tmpName 
				)

			) -- loop c

		) -- loop m 


	) -- loop lodNode 
) -- loop geomNode 



-- Make relative texture path into full path
--  Give the texture path the mod's rawData path currently setup from batch export dialog
--
if objMaterial != undefined then 
(
	if classof newTextureBasePath != String then
	(
		newTextureBasePath = bf2GetSetting "Bf2Batch.edtRawData"
		if newTextureBasePath.count > 0 then
		(
			newTextureBasePath = bf2Batch.makeTrailSlash newTextureBasePath
		)
		else newTextureBasePath = undefined
	)

	if classof newTextureBasePath == String then
	(
		BF2_SetMatBasePath objMaterial newTextureBasePath
	)
)



return rootNode

)

fn BF2_ImportMesh fname objName:undefined forLm:false s:undefined fileType:undefined templateInfo:#()=
(
if s == undefined then s = 1.0 / BF2_GetUnitMultiplier();

--format "BF2_ImportMesh()\n"

if classof objName != string then objName = getFilenameFile fname

format "fname: %\n" fname 
local obj = RSceneImport fname objName:objName forLm:forLm s:s fileType:fileType templateInfo:templateInfo

return obj
)

fn BF2ObjectImport fname:undefined forLm:true=
(
if fname == undefined then
(
	fname = getOpenFilename types:"con(*.con)|*.con|All|*.*|"
)

if fname != undefined then
(

	local geomTs = #()
	local templateInfo = bf2ReadObjectConForImport fname geomTs:geomTs

	local geomType = ".staticmesh"
	if geomTs.count > 0 then
	(
		geomType = "." + geomTs[1][1]

		local fnameMesh = (getFilenamePath fname) + "Meshes\\" + (getFilenameFile fname) + geomType

		local obj = BF2_ImportMesh fnameMesh forLm:forLm fileType:(getFilenameType fnameMesh) templateInfo:templateInfo 

		return obj
	)

)
return undefined
)



Any help would be MUUUUCH appreciated. Bensta has successfuly lightmapped a 2142 level using these tools so I know they work. It seems to be a specific 3ds max 9 problem. Thanks in advance (I hope)

Share this post


Link to post
Share on other sites

Hey all. My mod team is having a problem with the exporter in max 9. We follow the thread and have the vehicle folder premade. but still getting the .dat error. We can export successfully from max 8, but converting the file from 9 to 8 is adding 1000s of tris.

Share this post


Link to post
Share on other sites

Most useful thread up in here: http://bfeditor.org/forums/index.php?showtopic=5013

Make sure your hierarchy matches one of these depending on what youre doing.

Share this post


Link to post
Share on other sites

Hi!

Thanks a lot, but I've a problem: I've 3dsmax 9 and the program says me while exporting:

Unknown property: "saveMaterial" in undefined

could anyone help please?

Share this post


Link to post
Share on other sites

I have the most recent version of the POE tools installed. When I try to import a static mesh with 3dsm 2009 I get an error message.

Unknown property: "importmeshfile" in defined

In the script it highlights the following.

local rootNode = bf2mdtOps.importMeshFile fname lightmapInt s

I have read almost every post and can not find a fix.

Share this post


Link to post
Share on other sites

You should post over in the PoE tools thread. Here you stumbled across the original tools by Rexman which don't work even with Max 9.

We had a few success reports of running the PoE2 tools in the Max 9 version on Max 2008 . Are you sure you extracted the contents of the zip correctly into your Max folder ?

Max 2009 is of yet unknown to work with the tools. If you're a Max pro you could try to make them run and post your results :P

In case you have trouble running 'sceneparse.exe' try to set the XP compatibilty mode for it if you're testing the Vista OS on your machine.

I find the politics of Autodesk annoying to a high degree. Why do they release completely different version of more or less the same program so that never a script works for more than one or two versions ?

Share this post


Link to post
Share on other sites
You should post over in the PoE tools thread. Here you stumbled across the original tools by Rexman which don't work even with Max 9.

We had a few success reports of running the PoE2 tools in the Max 9 version on Max 2008 . Are you sure you extracted the contents of the zip correctly into your Max folder ?

Max 2009 is of yet unknown to work with the tools. If you're a Max pro you could try to make them run and post your results :P

In case you have trouble running 'sceneparse.exe' try to set the XP compatibilty mode for it if you're testing the Vista OS on your machine.

I find the politics of Autodesk annoying to a high degree. Why do they release completely different version of more or less the same program so that never a script works for more than one or two versions ?

I'm sure those that are versed in the max scripting language are capable of making small changes to their scripts with ease when new versions of Max are released. Unfortunately, those of us who aren't are at the mercy of those folks who are.

I've been working with the latest POE tools on 3ds Max 2008 (Win XP 32 bit) and they work fine so far for what I've been doing (which is importing/exporting static meshes). I have not tried exporting vehicles or tanks yet but plan to soon, I'll report back when I have more info.

The POE tools do not import/export at all for me on Vista 64bit with 3ds Max 2008 64bit. If anyone has a fix for this please please post.

Share this post


Link to post
Share on other sites
I'm sure those that are versed in the max scripting language are capable of making small changes to their scripts with ease when new versions of Max are released. Unfortunately, those of us who aren't are at the mercy of those folks who are.

I've been working with the latest POE tools on 3ds Max 2008 (Win XP 32 bit) and they work fine so far for what I've been doing (which is importing/exporting static meshes). I have not tried exporting vehicles or tanks yet but plan to soon, I'll report back when I have more info.

The POE tools do not import/export at all for me on Vista 64bit with 3ds Max 2008 64bit. If anyone has a fix for this please please post.

Maybe you guys could post over on the POE site and ask if there will be an update for the tools?

Share this post


Link to post
Share on other sites

Additional info for Max 9 users using the original tools from Rexman or the Doomlab package including the update. Rexman has released a fixed plugin for Max 9 long time ago and its still available at his website:

http://rex3d.net/bf2/files/3dsmax/Battlefi...Max9_Plugin.zip

After installation of the tools ( i used the Doomlab package ) unzip the new 'game_battlefield2.dlx' into your /3DSMax/plugins folder, over writing the old one. This fixes the above mentioned 'saveMat' error and other stuff related to the bf2mdtOps structure in Max 9.

Reverting to the doomlab tools prooved necessary for me as the PoE2 tools don't work correctly when exporting animated UV's ( at least for me )

Share this post


Link to post
Share on other sites

All of our modelling tutorials are based on Max ( and very little gmax ) which also means that we don't have much for Maya :P

Here you go from easy to complicated:

Statics:

http://bfeditor.org/forums/index.php?showtopic=12770

http://bfeditor.org/forums/index.php?showtopic=13381

Vehicles:

http://bfeditor.org/forums/index.php?showtopic=12835 ( not sure if this is complete )

http://bfeditor.org/forums/index.php?showtopic=13587

http://bfeditor.org/forums/index.php?showtopic=12461

http://bfeditor.org/forums/index.php?showtopic=9656

That should keep you busy for a while, hehehe

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×