TREEmagik news

Community Forums/Showcase/TREEmagik news

SabataRH(Posted 2003) [#1]


TREEmagik and TREEmagik Exotic is now known as TREEmagik PLUS. I've combinded the two packages into a single disturbution set for the same low price of the original TREEmagik.

ALl previous users of treemagik and everyone purchasing treemagik from here out will be entitled to TREEmagik PRO when it is released later next year - at no additional charge..

TRREmagik PLUS http://www.aliencodec.com


IPete2(Posted 2003) [#2]
Yehhooooo!

Thanks

IPete2.


sigi(Posted 2003) [#3]
Woooow, Thank you.
Great news.


Skitchy(Posted 2003) [#4]
Gonna have to get this when it comes out :)


*(Posted 2003) [#5]
woohoo, thanks :)


Techlord(Posted 2003) [#6]
Sabata,

Tried the demo, Loved it! Extremely User Friendly. Just a tad too pricy for me. I would be more inclined to purchase models made with this tool.


Daz(Posted 2003) [#7]
Sabata,

Is there any chance that other payment methods for the product could be set up such as Share-It?

Thanks.

Regards,
Daz.


SabataRH(Posted 2003) [#8]
Daz, I'm looking into starting up a new ShareIT account as we speak, i'll post more later..


InvisibleKid(Posted 2003) [#9]
ShareIt would be great i'll definately by it then......


SabataRH(Posted 2003) [#10]
I really despise SHAREit, I feel they are a piss-poor ran company.. they offer little help (when its needed the most). I've been tring to get my billing data changed with them for 3 months now... No luck yet.

Ive recently emailed a suppervisor there so as soon as this is straightened out i'll post note of it.. Sorry for the delay.

PS anyone know of alternative services besides shareit or paypal?


thanks.


Daz(Posted 2003) [#11]
Cheers Sabata for the info. Keep me updated and as soon has you find an alternative.

I have bought some software in the past through regsoft. Have a look at http://www.regsoft.com/index.shtml

How good they are from a sellers point of view I am not sure - but you could always give these a try.

Hope that helps.

Daz.


Beaker(Posted 2003) [#12]
BMTmicro are reputable. I use them.


SabataRH(Posted 2003) [#13]
Thanks guys, checking into these links now...


SabataRH(Posted 2003) [#14]
Ok got setup with RegSoft, the product should become active with them within 24hrs. I've linked my website but it won't connect until the product becomes active via RegSoft.

Working on a 3rd alternate plan with BMTMicro atm.


Daz(Posted 2003) [#15]
Excellent news Sabata. I will check your site tomorrow morning and place my order then.

Thanks for all the help.


Ross C(Posted 2003) [#16]
Yeah, PayPal was the reason i didn't buy treemagik :)


SabataRH(Posted 2003) [#17]
BMTmicro is a nice e-purchase option... I have successfully setup an account with these guys and been approved. They are fast, they have already activated the product, whoa took ages with paypal. Added the link to the Treemagik order form (secure). Thanks for the link MasterBeaker.

http://www.bmtmicro.com/BMTCatalog/win/treemagikplus.html


Mustang(Posted 2003) [#18]
$24.99 USD / 24.3306 EUR / 15.5924 GBP


Are you sure you that the € and £ prices are accurate enough? ;P


JoshK(Posted 2003) [#19]
Do you have any interest in writing an exporter for .csm prefabs? I could link you on the CShop site if your program could instantly export a prefab for CShop users.


SabataRH(Posted 2003) [#20]
Can sure give it a try, got a format/sdk sheet for your format avialable?


JoshK(Posted 2004) [#21]
Here's code for a 3ds>CSM converter. If you need any more help, ask.

If Not Windowed3D() RuntimeError "You must change your desktop depth to 16-bit color to run this program."

Include "progs\functions\appendbyte.bb"
Include "progs\functions\appendint.bb"
Include "progs\functions\appendfloat.bb"
Include "progs\functions\appendshort.bb"
Include "progs\functions\appendstring.bb"
Include "progs\functions\pokestring.bb"
Include "light_progs\updatenormals.bb"

Const FLAG_SELECTED=0
Const FLAG_POLYGON=1
Const FLAG_NOSCALE=2
Const FLAG_AUTOMAP=3
Const FLAG_LIGHTMAPS=4
Const FLAG_VERTEXLIGHTS=5
Const FLAG_CASTLIGHTMAPSHADOWS=6
Const FLAG_CASTVERTEXSHADOWS=7

AppTitle "Cartography Shop model converter"
;file$=CommandLine()
;file=Remove(file,Chr(34))
;If file="" file$=RequestFile_("",CurrentDir(),"X or 3DS Model|*.*",0,0,0)
;If file="" End

patternposition=4

.loop

file$=getopenfile("Make prefab","","3D Studio file (*.3ds)|*.3ds|Microsoft DirectX Model (*.x)|*.x|Cartography Shop 3 map (*.csm)|*.csm|Blitz3D Model (*.b3d)|*.b3d|All files|*.*",patternposition)
If file="" End
patternposition=SelectedPattern()
If Lower(FileExtension(file))="csm"
	convertcsm file
	Else
	convertmesh file
	EndIf
If proceed("Convert more files?") Goto loop

End

Graphics3D 400,300,16,2

progpath$=CurrentDir()

ChangeDir progpath+"prefabs"

d=ReadDir(CurrentDir())
Repeat
	file$=NextFile(d)
	DebugLog file
	Select FileType(file)
		Case 0
			Exit
		Case 1
		Case 2
			If file<>"." And file<>".."
				d2=ReadDir(file)
				Repeat
					file2$=NextFile(d2)
					If file2="" Exit
					DebugLog (file+"\"+file2)
					Select FileType(file+"\"+file2)
						Case 0
							Exit
						Case 1
							ext$=Lower(FileExtension(file2))
							If ext="3ds" Or ext="x" Or ext="b3d"
								convertmesh file+"\"+file2
								EndIf
						Case 2
						End Select
					Forever
				CloseDir d2
				EndIf
		End Select
	Forever
CloseDir d
End

ChangeDir progpath+"meshes"
d2=ReadDir(CurrentDir())
If d2
	Repeat
		file2$=NextFile(d2)
		If file2="" Exit
		DebugLog (file2)
		Select FileType(file2)
			Case 0
				Exit
			Case 1
				ext$=Lower(FileExtension(file2))
				If ext="3ds" Or ext="x" Or ext="b3d"
					convertmesh ".\"+file2
					EndIf
			Case 2
			End Select
		Forever
	CloseDir d2
	EndIf

Function convertcsm(file$)

f=ReadFile(file)
If Not f
	notify "Failed to load "+Chr(34)+file+Chr(34)+"."
	Return False
	EndIf
	
groupbank=CreateBank()
lightmapbank=CreateBank()
meshbank=CreateBank()
entitybank=CreateBank()

version=ReadInt(f)
If version=2 Or version=4
	notify Chr(34)+file+Chr(34)+" is not a Cartography Shop 3 map."
	Return False
	EndIf

SeekFile f,0

While Not Eof(f)

	tag$=""
	For n=0 To 3
		tag=tag+Chr(ReadByte(f))
		Next
	size=ReadInt(f)
	DebugLog "	Loading "+tag+" - "+size+" bytes..."
	endposition=size+FilePos(f)

	Select tag

		Case "LMAP"
			width=ReadInt(f)
			height=ReadInt(f)
			;t=CreateTexture(width,height)
			;TextureCoords t,1
			;SetBuffer TextureBuffer(t)
			;LockBuffer TextureBuffer(t)
			appendInt lightmapbank,width
			appendint lightmapbank,height
			For x#=0 To width-1
				For y#=0 To height-1
					hue=ReadInt(f)
					;appendbyte lightmapbank,Red(hue)
					;appendbyte lightmapbank,Green(hue)
					;appendbyte lightmapbank,Blue(hue)
					appendint lightmapbank,hue
					Next
				Next
			;UnlockBuffer TextureBuffer(t)
			;SetBuffer BackBuffer()
			clm=clm+1
			;SaveBuffer TextureBuffer(t),"maps\"+FileName(file,False)+"_LM"+clm+".bmp"
			
			;dynamicfile$="textures\specular\"+FileName(file,False)+clm+".bmp"
			;If FileType(dynamicfile$)=1
			;	t2=LoadTexture(dynamicfile$)
			;	TextureCoords t2,1
			;	TextureBlend t2,3
			;	EndIf
						
			;appendint lmapbank,t
;			t2=CreateTexture(2048,2048)
;			TextureBlend t2,2
			;If FileType(dynamicfile$)=1
			;	t2=LoadTexture(dynamicfile$)
			;	TextureBlend t2,0
			;	TextureCoords t2,1
			;	sh.shader=New shader
			;	sh\texture=t
			;	sh\parameter[2]=t2
			;	sh\class=SHADER_DYNAMICLIGHT
			;	sh\image2=LoadImage("maps\"+FileName(file,False)+"_LM"+clm+".bmp")
			;	EndIf
			;appendint addlmapbank,t2
			;t2=0
			
		Case "GRUP"
			group=ReadInt(f)
			r=ReadInt(f)
			g=ReadInt(f)
			b=ReadInt(f)
			cgr=cgr+1
			
		Case "BRUS"
			flags=ReadInt(f)
			hue=ReadInt(f)
			group=ReadInt(f)
			Properties$=ReadStringN(f)
			surfcount=ReadInt(f)
			
			appendint meshbank,(2^3+2^4+2^6+2^7)
			appendint meshbank,group
			appendstring meshbank,Properties$
			appendint meshbank,0
			appendint meshbank,0
			appendint meshbank,0
			appendfloat meshbank,0
			appendfloat meshbank,0
			appendfloat meshbank,0
			appendint meshbank,surfcount
			
			;mesh=CreateMesh(map)
			;NameEntity mesh,Properties
			;appendint entitybank,mesh

			For s=1 To surfcount
				nx#=ReadFloat(f)
				ny#=ReadFloat(f)
				nz#=ReadFloat(f)
				d#=ReadFloat(f)
				materialname$=readstringn(f)
				lightmap=ReadInt(f)
				uoffset#=ReadFloat(f)
				voffset#=ReadFloat(f)
				uscale#=ReadFloat(f)
				vscale#=ReadFloat(f)
				angle#=ReadFloat(f)
				vertcount=ReadInt(f)
				
				appendint meshbank,0
				appendstring meshbank,materialname
				appendint meshbank,lightmap
				appendfloat meshbank,0
				appendfloat meshbank,0
				appendfloat meshbank,1
				appendfloat meshbank,1
				appendfloat meshbank,0
				appendint meshbank,vertcount
				appendint meshbank,vertcount-2
				appendint meshbank,0
				
				;skipface=False
				;If Lower(FileName(materialname,False))="caulk" skipface=True
				;If Not skipface
				;	surf=CreateSurface(mesh)
				;	b=retrievematerial("textures\"+materialname)
				;	If lightmap
				;		t=PeekInt(lmapbank,(lightmap-1)*4)
				;		BrushTexture b,t,0,LAYER_LIGHTMAP
				;		EndIf
				;	PaintSurface surf,b
				;	If lightmap reloadmaterial b;Get rid of lightmap texture
				;	EndIf
				DebugLog vertcount
				For v=0 To vertcount-1
					x#=ReadFloat(f)
					y#=ReadFloat(f)
					z#=ReadFloat(f)
					nx#=ReadFloat(f)
					ny#=ReadFloat(f)
					nz#=ReadFloat(f)
					If nx<>0 RuntimeError nx
					u0#=ReadFloat(f)
					v0#=ReadFloat(f)
					u1#=ReadFloat(f)
					v1#=ReadFloat(f)
					
					appendfloat meshbank,x
					appendfloat meshbank,y
					appendfloat meshbank,z
					appendfloat meshbank,nx
					appendfloat meshbank,ny
					appendfloat meshbank,nz
					appendint meshbank,128
					appendint meshbank,128
					appendint meshbank,128
					appendfloat meshbank,u0
					appendfloat meshbank,v0
					appendfloat meshbank,0
					appendfloat meshbank,u1
					appendfloat meshbank,v1
					appendfloat meshbank,0
					
					;If Not skipface
					;	AddVertex surf,x,y,z,u0,v0
					;	VertexColor surf,v,255,255,255		
					;	VertexNormal surf,v,nx,ny,nz					
					;	VertexTexCoords surf,v,u1,v1,0,1
					;	If v>1 AddTriangle surf,v,v-1,0
					;	EndIf
					
					Next
				
				;triscount=ReadInt(f)
				;DebugLog triscount

				For v=2 To vertcount-1
					appendint meshbank,v
					appendint meshbank,0
					appendint meshbank,v-1
					Next
				
				;appendint meshbank,0;no lines
			
				Next

			cmh=cmh+1
			;UpdateNormals_ mesh
		
		Case "ENTY"
			flags=ReadInt(f)
			x#=ReadFloat(f)
			y#=ReadFloat(f)
			z#=ReadFloat(f)
			Properties$=ReadStringN(f)
			group=ReadInt(f)
			r=ReadInt(f)
			g=ReadInt(f)
			b=ReadInt(f)
			width=ReadInt(f)
			heigth=ReadInt(f)
			
			cen=cen+1
			
			appendint entitybank,0
			appendint entitybank,0
			appendstring entitybank,Properties$
			appendfloat entitybank,x
			appendfloat entitybank,y
			appendfloat entitybank,z
			
			;entity=CreateMesh(map)
			;PositionEntity entity,x,y,z
			;NameEntity entity,Properties
			;appendint entitybank,entity

		Case "MESH"
			flags=ReadInt(f)
			hue=ReadInt(f)
			group=ReadInt(f)
			Properties$=ReadStringN(f)
			;If getproperty(Properties$,"classname")=""
			;	Properties$=Properties$+Chr(10)+Chr(34)+"classname"+Chr(34)+"="+Chr(34)+"staticmesh"+Chr(34)
			;	EndIf
			materialname$=ReadStringN(f)
			vertcount=ReadInt(f)
			
			appendint meshbank,(2^5+2^6+2^7)
			appendint meshbank,group
			appendstring meshbank,Properties$
			appendint meshbank,0
			appendint meshbank,0
			appendint meshbank,0
			appendfloat meshbank,0
			appendfloat meshbank,0
			appendfloat meshbank,0
			appendint meshbank,1; surface

			appendint meshbank,0
			appendstring meshbank,materialname
			appendint meshbank,0
			appendfloat meshbank,0
			appendfloat meshbank,0
			appendfloat meshbank,1
			appendfloat meshbank,1
			appendfloat meshbank,0
			appendint meshbank,vertcount
			pos=BankSize(meshbank)
			appendint meshbank,0
			appendint meshbank,0
						
			;mesh=CreateMesh(map)
			;NameEntity mesh,Properties
			;surf=CreateSurface(mesh)
			;appendint entitybank,mesh

			;b=retrievematerial("textures\"+materialname)
			;BrushShininess b,1
			;PaintSurface surf,b
			
			For v=0 To vertcount-1
				x#=ReadFloat(f)
				y#=ReadFloat(f)
				z#=ReadFloat(f)
				nx#=ReadFloat(f)
				ny#=ReadFloat(f)
				nz#=ReadFloat(f)
				u0#=ReadFloat(f)
				v0#=ReadFloat(f)
				u1#=ReadFloat(f)
				v1#=ReadFloat(f)
				hue=ReadInt(f)
				;AddVertex surf,x,y,z,u0,-v0
				;VertexColor surf,v,Red(hue),Green(hue),Blue(hue)				
				;VertexNormal surf,v,nx,ny,nz
				
				appendfloat meshbank,x
				appendfloat meshbank,y
				appendfloat meshbank,z
				appendfloat meshbank,nx
				appendfloat meshbank,ny
				appendfloat meshbank,nz
				appendint meshbank,128
				appendint meshbank,128
				appendint meshbank,128
				appendfloat meshbank,u0
				appendfloat meshbank,v0
				appendfloat meshbank,0
				appendfloat meshbank,u1
				appendfloat meshbank,v1
				appendfloat meshbank,0				
				
				Next

			triscount=ReadInt(f)
			PokeInt meshbank,pos,triscount
			
			For t=0 To triscount-1
				a=ReadInt(f)
				b=ReadInt(f)
				c=ReadInt(f)
					
				appendint meshbank,b
				appendint meshbank,a
				appendint meshbank,c
					
				Next
				
			;UpdateNormals_ mesh
			cmh=cmh+1

		Default
			DebugLog "	Unknown chunk."
		
		End Select
	SeekFile f,endposition			
	Wend
CloseFile f

f=WriteFile(FileDir(file)+FileName(file,0)+"_v4.csm")

WriteInt f,4
WriteInt f,0
WriteInt f,0;clm
;For n=0 To BankSize(lightmapbank)-1
;	WriteByte f,PeekByte(lightmapbank,n)
;	Next
WriteInt f,cmh
For n=0 To BankSize(meshbank)-1
	WriteByte f,PeekByte(meshbank,n)
	Next
WriteInt f,cen
For n=0 To BankSize(entitybank)-1
	WriteByte f,PeekByte(entitybank,n)
	Next
WriteFloat f,0
WriteFloat f,500
WriteFloat f,-500
WriteFloat f,-45
WriteFloat f,0

CloseFile f
Return True
End Function

Function convertmesh(file$)

m=LoadAnimMesh(file)
If Not m
	notify "Failed to load "+Chr(34)+file+Chr(34)
	Return False
	EndIf

outfile$=FileDir(file)+FileName(file,0)+".csm"
f=WriteFile(outfile)
If Not f
	notify "Failed to write "+Chr(34)+outfile+Chr(34)
	Return False
	EndIf

WriteInt f,4;version
WriteInt f,0;groups
WriteInt f,0;lightmaps
WriteInt f,1;meshes
WriteInt f,2+2^FLAG_CASTLIGHTMAPSHADOWS+2^FLAG_VERTEXLIGHTS+2^FLAG_CASTVERTEXSHADOWS;flags
WriteInt f,1;group
WriteByte f,0;properties
WriteInt f,255
WriteInt f,255
WriteInt f,255
WriteFloat f,0
WriteFloat f,0
WriteFloat f,0

pos=FilePos(f)
WriteInt f,0
sum=writemesh(m,f)

WriteInt f,0;entities

WriteFloat f,0;x
WriteFloat f,500;y
WriteFloat f,-500;z
WriteFloat f,-45;pitch
WriteFloat f,0;yaw

SeekFile f,pos
WriteInt f,sum


CloseFile f
Return True
End Function

Function writemesh(m,f)
UpdateNormals m
LightMesh m,220,220,220,1000000,1000,1000,1000
For s=1 To CountSurfaces(m)
	sum=sum+1
	surf=GetSurface(m,s)
	WriteInt f,0;flags
	WriteByte f,0;texture
	WriteInt f,0;lightmapindex
	WriteFloat f,0
	WriteFloat f,0
	WriteFloat f,1
	WriteFloat f,1
	WriteFloat f,0
	WriteInt f,CountVertices(surf)
	WriteInt f,CountTriangles(surf)
	WriteInt f,0;no lines
	For v=0 To CountVertices(surf)-1
		TFormPoint VertexX(surf,v),VertexY(surf,v),VertexZ(surf,v),m,0
		WriteFloat f,TFormedX()
		WriteFloat f,TFormedY()
		WriteFloat f,TFormedZ()
		TFormNormal VertexNX(surf,v),VertexNY(surf,v),VertexNZ(surf,v),m,0
		WriteFloat f,TFormedX()
		WriteFloat f,TFormedY()
		WriteFloat f,TFormedZ()
		r=VertexRed(surf,v)
		g=VertexGreen(surf,v)
		b=VertexBlue(surf,v)
		If r<50 r=50
		If g<50 g=50
		If b<50 b=50
		WriteInt f,r
		WriteInt f,g
		WriteInt f,b
		WriteFloat f,VertexU(surf,v)
		WriteFloat f,-VertexV(surf,v)
		WriteFloat f,VertexW(surf,v)
		WriteFloat f,VertexU(surf,v,1)
		WriteFloat f,VertexV(surf,v,1)
		WriteFloat f,VertexW(surf,v,1)
		Next
	For t=0 To CountTriangles(surf)-1
		WriteInt f,TriangleVertex(surf,t,1)
		WriteInt f,TriangleVertex(surf,t,0)
		WriteInt f,TriangleVertex(surf,t,2)
		Next
	Next
For c=1 To CountChildren(m)
	sum=sum+writemesh(GetChild(m,c),f)
	Next
Return sum
End Function

Function ReadStringN$(f,maxlength=0)
Repeat
	ch=ReadByte(f)
	If ch=0 Return t$
	If maxlength
		If Len(t$)=maxlength Return t$+Chr(ch)
		EndIf
	t$=t$+Chr$(ch)
	Forever
End Function

Function GetOpenFile$(title$="",path$="",pattern$="All files|*.*",patternposition=0,multi=0)
Return RequestFile$(title$,path$,pattern$,patternposition,1,1)
End Function



SabataRH(Posted 2004) [#22]
Thanks, that should be more then enough help... all but for the "You must change your desktop depth to 16-bit color to run this program."

That could prove to be a problem requirement for an export option.


SabataRH(Posted 2004) [#23]
Got it in, seems to be working although i've no real way of testing the exported file.

Halo, grab this and let me know if it loads in your cs4. Thanks.

http://www.aliencodec.com/temp/test.csm


JoshK(Posted 2004) [#24]
It works.

I am emailing you to discuss this further.