Page 5 of 6

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D programs

Posted: 15 Sep 2010 05:44
by Tattoo
I'd like to see the action you use in PS. I also use one but I get some blue pixels around the edges that I just can't get rid of. I also think it would be better if you used the same model in each scene. I'm not able to see the differences from one to the other since you used different models in each scene but from what you shown, the top 2 look the same.

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 16 Sep 2010 13:47
by K.Y.Chung
I've modified the previous reply. All the previews come from the same model. Comments are still wanted and it's absolutely OK if you think all these 3 are not good enough.

Tattoo: here is my PS action, but there are some precautions:
1. Set "Image Interpolation" to be "Bicubic Sharper" in "Preferences"->"General"
2. You will be unable to copy and paste anything while the action is running as the clipboard will be "hijacked".
3. There are many actions in my file. Just have a look at "Action for Railway Cars" if you want to learn the algorithm, but it is OK if you have interest to investigate the others of course. Most of them do the same things except the scale, but some of them have not been modified for ages so I'm not sure whether they can run properly with newer versions of PS.
4. What the last 3 steps do are to apply the palette. I'm not sure whether it can run properly when the palette files are absent. Only choose to run one of these 3 steps: The 1st one applies a normal vehicle palette, while the 2nd and the 3rd one apply the palette with company colors and primary company colors only respectively. Just delete them and record this step again if they throw out errors.

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 18 Sep 2010 02:21
by Tattoo
Thanks K.Y. for sharing those. Yours is way more involved than the one I setup. It's interesting how you got it to work as good as you did. Altho, I don't like that it deforms the roof edge some. It took me a minute to figure out how large you render your sprites to get the correct size to have a 110x110 sprite but I got it. I didn't look at the others yet tho. Thanks again...

EDIT: I just ran thru the steps in your action and it's actually not much different than the one I made except you use 'Free Transform' to scale the image down. The only part I'm wondering about is the size you render to. In the one step, it selects pixels at 1079 x 1919. So I'm guessing that you render your sprites at something like 1100 x 2000. That's pretty darn high. I only render to 330 x 330. Your way does work better than mine tho and thanks again for sharing them. After I found the correct size you rendered to, the roof edge isn't deformed.

I rendered a couple sprites at 1000 x 1000 cuz my camera is setup square and your action works great. It deformed the roof edge before, I guess because I had the wrong render size before. Thansk again. This actually works better than fusion. Fusion gives a dark edge around the model that I can't get rid of. I'll be using this more now..

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 26 Nov 2010 05:57
by cards525
Allite... So I got this 3d model to create a couple things...
What program should I use to make industries?
Ships?
Cars?

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 26 Nov 2010 09:17
by X.G.fr0sty
What ever program you feel best at... because mind you, you also got to create the images required.

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 26 Nov 2010 09:49
by cards525
BlenderUser wrote:What ever program you feel best at... because mind you, you also got to create the images required.
I meant I have the 3d models and that stuff... Just what program converts them into Usable DATS?

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 26 Nov 2010 23:32
by X.G.fr0sty
well depending on what you used to create the models... Locomotion uses dats; that are formed by coding, and sprites/images.

Now somewhere around here (If I can find the like ill post); theres a list of the angels that the images need to be in, and how many.

Also, the coding, will be a bit tricky if you plan on doing it yourself (But as time goes on you may be faster).
The Tool is called.. LocoTool... (May have to do a little searching); but you just need to move the images files and the coding file into locotool and a .dat should be created (I think; its been ages)

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 14 Jan 2011 14:24
by K.Y.Chung
I've just found some typing mistake in the blender rendering script which may cause errors. Please download it again and I'm sorry for any inconvenience caused :oops:

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 24 Feb 2011 11:30
by K.Y.Chung
I've had an idea of proposing a complete solution for those who would like to stick to open-source software when there are plenty of people asking me how to make the objects. The macro recording function of Photoshop is great, but it is absent in gimp. I've spent several months on learning script-fu to automate sprite preparation by gimp, and a little success has been achieved. 8)

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 25 Feb 2011 15:51
by maquinista
I can send You some GIMP and IrfanView scripts for Windows.

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 11 Mar 2011 04:01
by K.Y.Chung
I've just finished the very first version of the sprite processing script for GIMP, but there are a few limitations and precautions:

1. Copy & paste the script into a .scm file using notepad, then put the file under
(install directory of GIMP)\share\gimp\2.0\scripts\
2. The script will become available under Main Menu -> Tools -> Batch Sprite Processing
2. You need to prepare and add the palettes manually into GIMP first before you can apply them to the images (don't ask me how to do so since you can learn it by having a look at GIMP documentation).
3. Adjusting dither amount is impossible in GIMP
4. It only accepts PNGs as input images.

The only advantage of using this GIMP script over PS macro is that it will not "hijack" the clipboard. I haven't tried to compare the resulting sprites prepared by these 2 ways as the script is developed in my office during working hours :lol: :lol:

Code: Select all

(define (script-fu-sprite-process-batch inDir scale palette)
	(let*
		(
			(file-list (cadr (file-glob (string-append inDir "\\*.png") 1)))
		)
		(while (not (null? file-list))
			(let*
				(
					(file-name (car file-list))
					(image (car (gimp-file-load 0 file-name file-name)))
					(drawable (car (gimp-image-active-drawable image)))
					(base-layer (aref (car (cdr (gimp-image-get-layers image))) 0))
					(base-layer-duplicated (car (gimp-layer-copy base-layer TRUE)))
					(mask-layer (car (gimp-layer-copy base-layer TRUE)))
					(image-width (car (gimp-image-width image)))
					(image-height (car (gimp-image-height image)))
					(new-width (* scale image-width))
					(new-height (* scale image-height))
				)

				(gimp-layer-add-alpha base-layer)
				(gimp-image-add-layer image base-layer-duplicated -1)
				(gimp-image-set-active-layer image base-layer-duplicated)
				(set! drawable (car (gimp-image-active-drawable image)))
				(gimp-selection-all image)
				(gimp-selection-shrink image 1)
				(gimp-by-color-select drawable '(0 0 255) 0 3 FALSE FALSE 0 FALSE)
				(gimp-edit-clear drawable)
				(gimp-selection-none image)
				(gimp-layer-scale-full base-layer-duplicated new-width new-height FALSE 3)

				(gimp-image-set-active-layer image base-layer)
				(gimp-layer-scale-full base-layer new-width new-height FALSE 0)

				(gimp-image-add-layer image mask-layer -1)
				(gimp-image-set-active-layer image mask-layer)		
				(set! drawable (car (gimp-image-active-drawable image)))
				(gimp-by-color-select drawable '(0 0 255) 0 0 FALSE FALSE 0 FALSE)
				(gimp-image-raise-layer-to-top image mask-layer)
				(gimp-selection-invert image)
				(gimp-layer-add-alpha mask-layer)
				(gimp-edit-clear drawable)
				(gimp-layer-scale-full mask-layer new-width new-height FALSE 0)
				(gimp-image-crop image new-width new-height 0 0)
				(gimp-image-merge-visible-layers image 2)
				(gimp-selection-none image)
				(set! drawable (car (gimp-image-active-drawable image)))
				(gimp-convert-indexed image 2 4 256 FALSE FALSE palette)
				(file-png-save2 1 image drawable file-name file-name 0 9 0 0 0 0 0 0 1)
				(gimp-image-delete image)
			)
			(set! file-list (cdr file-list))
		)			
	)			
)

(script-fu-register
	"script-fu-sprite-process-batch"														;func name
	"Batch Sprite Processing"															;menu label
	"Process the sprites generated by 3D programs for use in Locomotion"							;description
	"K.Y.Chung"																	;author
	"copyright 2011, K.Y.Chung; 2009, the GIMP Documentation Team"							;copyright notice
	"23 Feb 2011"																	;date created
	"*"																			;image type that the script works on
	SF-DIRNAME	"Input Directory"			""
	SF-VALUE		"Scale Factor"				"0.1"
	SF-PALETTE	"Palette Name"				""
)
(script-fu-menu-register "script-fu-sprite-process-batch" "<Image>/Tools")

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 06 Jul 2011 15:40
by K.Y.Chung
Here is a good news for Blender users (including me of course :lol: ) The stable version of the rendering script for Blender 2.5+ has been completed. The old reply with the quick and dirty adaptation of the script has been deleted since we don't need it anymore :P Most known bugs have been solved. It is really painful for migrating from Blender 2.4x to 2.5x but I've found the beauty and elegance of the latter. The UI of the rendering script has been integrated into the UI of Blender prefectly. I've provided 2 branches of the rendering script, they do exactly the same thing except they are called from different areas.

Let me have a quick introduction on how to use it first:
auto_renderer_usage.png
(222.31 KiB) Downloaded 2 times
1. Open the "User Preferences" window
2. Click "Install Add-On" and add the zip file downloaded below. I'm not sure whether it really works, but you can extract and then add the 2 .py files separately if it fails. You can add one of them only also, depends on your needs.
3. Choose "Render" category to browse the related add-ons.
4. Enable those add-ons titled "Auto renderer for Locomotion. Again it's totally up to you to choose any one of them to activate.
5. If you choose Menu Edition, the script can be fired by choosing "Render for Locomotion" under "Render" in the main menu.
6. If you choose Panel Edition, the script can be fired on the last tab in "Render" tab under Properties window.

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 24 Jul 2011 09:20
by mc.crab
K.Y.Chung, I tried your rendering script but when I try to run it, it just causes blender to freeze. I'm using blender 2.58 and I installed the script with your instructions.

Edit: Actually it didn't freeze, alltough I couldn't do anything it was still taking pictures. I used the option to rotate the mesh object and I got about 20 identical imaged (20 because I thought that Blender froze so I closed it).

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 29 Jul 2011 16:24
by K.Y.Chung
mc.crab wrote:K.Y.Chung, I tried your rendering script but when I try to run it, it just causes blender to freeze. I'm using blender 2.58 and I installed the script with your instructions.

Edit: Actually it didn't freeze, alltough I couldn't do anything it was still taking pictures. I used the option to rotate the mesh object and I got about 20 identical imaged (20 because I thought that Blender froze so I closed it).
Yes, Blender will appear to be frozen when the script is running. Just keep patient until all the 136 images (in case of railway vehicles) have been generated. You can verify this by opening the output directory to see if new images keep generated or not. Sometimes you may also need to keep refresh the explorer window to browse new images. If you've already got 20 images generated and there is nothing wrong on those images, the script is supposed to be running properly :wink:

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 30 Jul 2011 19:01
by mc.crab
Ok thanks.
There is a problem with the images. For some reason every image was takes from the same angle. So I had sprite.001 20 times.

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 09 Aug 2011 13:37
by K.Y.Chung
Sorry for answering late as I don't visit here frequently recently, after I've finished my rail vehicle packs scheduled this year :lol:

I guest your vehicle is composed with several objects. You need to merge all the "parts" into a single mesh object and being selected as the active object before running the script. Try again and feel free to ask me if you still have problems. :wink:

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 09 Aug 2011 15:12
by mc.crab
Thanks, it works :D :D

Sketchup To DAT

Posted: 17 Aug 2011 18:27
by 73790
I was wondering how to you convert a file from sketchup into a dat or blender file, cause i was working on a station thats very cool and i wanna try it in the game, i might release it too, i searched and couldn't find anything helpful.

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 18 Aug 2011 15:51
by K.Y.Chung
You can export the sketchup file into .DAE (collada) format then import it in Blender. If you are using sketchup pro , you can export the model into .3DS also (and it should be a better choice). You need to break down the model until it can't be further broken down before exporting. Of course, you also need to adjust the materials, scale, lights....etc to get the best result 8)

Re: [Discussion] Sketchup, Blender, 3Dmax and other 3D progr

Posted: 25 Aug 2011 16:37
by 73790
K.Y.Chung wrote:You can export the sketchup file into .DAE (collada) format then import it in Blender. If you are using sketchup pro , you can export the model into .3DS also (and it should be a better choice). You need to break down the model until it can't be further broken down before exporting. Of course, you also need to adjust the materials, scale, lights....etc to get the best result 8)
Ok since im using sketchup(not pro) i import into blender, but after that how to i get it to a DAT File?