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

Discuss, get help with, or post new modifications, graphics or related tools for Locomotion in this forum.

Moderator: Locomotion Moderators

User avatar
Tattoo
Director
Director
Posts: 597
Joined: 03 Jan 2009 18:17
Location: Chicago

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

Post 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.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
: : = FYRA v250 = : : = AU NSW 86 Class Electric Locomotive = : : = AU QR EDI Bombadier IMU/SMU Trainset = : : = B-Class & VicPass = : : = MSTS Scotsman = : : = US Semi Trucks Pack = : :
: : = Steel Bridge = : : = Tube Bridge = : : = 2 New Earth Slopes = : : = Default Bridges w/ New Slopes added = : : = Camera Angles for Shape Viewer = : : = EU Semi Trucks Pack = : : = US Tank Cars 56' = : :
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
K.Y.Chung
Transport Coordinator
Transport Coordinator
Posts: 350
Joined: 03 Oct 2009 09:30
Contact:

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

Post 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.
Attachments
Automation for Loco(01062010).zip
(7.53 KiB) Downloaded 401 times
Visit Nanyue Express for my railway car drawings
User avatar
Tattoo
Director
Director
Posts: 597
Joined: 03 Jan 2009 18:17
Location: Chicago

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

Post 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..
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
: : = FYRA v250 = : : = AU NSW 86 Class Electric Locomotive = : : = AU QR EDI Bombadier IMU/SMU Trainset = : : = B-Class & VicPass = : : = MSTS Scotsman = : : = US Semi Trucks Pack = : :
: : = Steel Bridge = : : = Tube Bridge = : : = 2 New Earth Slopes = : : = Default Bridges w/ New Slopes added = : : = Camera Angles for Shape Viewer = : : = EU Semi Trucks Pack = : : = US Tank Cars 56' = : :
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
User avatar
cards525
Traffic Manager
Traffic Manager
Posts: 144
Joined: 28 Feb 2009 16:27
Skype: cards525
Location: Chicago, Illinois, United States
Contact:

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

Post by cards525 »

Allite... So I got this 3d model to create a couple things...
What program should I use to make industries?
Ships?
Cars?
X.G.fr0sty
Chief Executive
Chief Executive
Posts: 675
Joined: 20 Nov 2005 12:10
Location: Australia; Melbourne

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

Post by X.G.fr0sty »

What ever program you feel best at... because mind you, you also got to create the images required.
Image
User avatar
cards525
Traffic Manager
Traffic Manager
Posts: 144
Joined: 28 Feb 2009 16:27
Skype: cards525
Location: Chicago, Illinois, United States
Contact:

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

Post 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?
X.G.fr0sty
Chief Executive
Chief Executive
Posts: 675
Joined: 20 Nov 2005 12:10
Location: Australia; Melbourne

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

Post 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)
Image
K.Y.Chung
Transport Coordinator
Transport Coordinator
Posts: 350
Joined: 03 Oct 2009 09:30
Contact:

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

Post 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:
Visit Nanyue Express for my railway car drawings
K.Y.Chung
Transport Coordinator
Transport Coordinator
Posts: 350
Joined: 03 Oct 2009 09:30
Contact:

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

Post 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)
Visit Nanyue Express for my railway car drawings
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

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

Post by maquinista »

I can send You some GIMP and IrfanView scripts for Windows.
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
K.Y.Chung
Transport Coordinator
Transport Coordinator
Posts: 350
Joined: 03 Oct 2009 09:30
Contact:

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

Post 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")
Visit Nanyue Express for my railway car drawings
K.Y.Chung
Transport Coordinator
Transport Coordinator
Posts: 350
Joined: 03 Oct 2009 09:30
Contact:

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

Post 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.
Attachments
auto_renderer_3.zip
(5.97 KiB) Downloaded 335 times
Visit Nanyue Express for my railway car drawings
mc.crab
Traffic Manager
Traffic Manager
Posts: 145
Joined: 06 Jun 2010 10:08
Location: Finland

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

Post 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).
- Fractal design R3 case - Asus P8P67 Motherboard - Intel Core i7-2600k 3,4Ghz - AMD Radeon HD6950 Direct CU II 2GB - 8GB DDR3 1600Mhz -
K.Y.Chung
Transport Coordinator
Transport Coordinator
Posts: 350
Joined: 03 Oct 2009 09:30
Contact:

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

Post 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:
Visit Nanyue Express for my railway car drawings
mc.crab
Traffic Manager
Traffic Manager
Posts: 145
Joined: 06 Jun 2010 10:08
Location: Finland

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

Post 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.
- Fractal design R3 case - Asus P8P67 Motherboard - Intel Core i7-2600k 3,4Ghz - AMD Radeon HD6950 Direct CU II 2GB - 8GB DDR3 1600Mhz -
K.Y.Chung
Transport Coordinator
Transport Coordinator
Posts: 350
Joined: 03 Oct 2009 09:30
Contact:

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

Post 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:
Visit Nanyue Express for my railway car drawings
mc.crab
Traffic Manager
Traffic Manager
Posts: 145
Joined: 06 Jun 2010 10:08
Location: Finland

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

Post by mc.crab »

Thanks, it works :D :D
- Fractal design R3 case - Asus P8P67 Motherboard - Intel Core i7-2600k 3,4Ghz - AMD Radeon HD6950 Direct CU II 2GB - 8GB DDR3 1600Mhz -
73790
Engineer
Engineer
Posts: 111
Joined: 29 Jun 2011 14:02
Skype: southwest7371
Location: United States

Sketchup To DAT

Post 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.
K.Y.Chung
Transport Coordinator
Transport Coordinator
Posts: 350
Joined: 03 Oct 2009 09:30
Contact:

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

Post 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)
Visit Nanyue Express for my railway car drawings
73790
Engineer
Engineer
Posts: 111
Joined: 29 Jun 2011 14:02
Skype: southwest7371
Location: United States

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

Post 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?
Post Reply

Return to “Locomotion Graphics, Modifications & Tools”

Who is online

Users browsing this forum: No registered users and 6 guests