Some handy scripts
Re: Some handy scripts
The shell script works OK for Linux but it's a pain to get it working on Windows. You'd need to install Cygwin and you'd still have unix/dos line ending issues.
I unlocked DJ's post. Let the noob spamming begin!
I unlocked DJ's post. Let the noob spamming begin!
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 348
- Joined: Sun Sep 11, 2011 9:16 pm
- Team: PoGo
Re: Some handy scripts
loljlv wrote:The shell script works OK for Linux but it's a pain to get it working on Windows. You'd need to install Cygwin and you'd still have unix/dos line ending issues.
I unlocked DJ's post. Let the noob spamming begin!
-
- Posts: 4132
- Joined: Tue Oct 21, 2008 5:20 pm
- Location: Washington, USA
- Contact:
Re: Some handy scripts
JM Scaling Scriptjlv wrote:You should make it take separate x, y and z scales so you can use it for making billboard to full detail transition models. Look near the end of this post (Smoothing the LOD Transistion) for an example of when it would be useful.
Which topic is locked?
New:
--Will not allow identical input/output filenames
--Separate x, y, z multipliers
Syntax-
Code: Select all
python jm_scaler.py input.jm scale_x scale_y scale_z output.jm
Wheels wrote:Let me know if you have problems. It only works for JM1 files. And it only works with Python 2.6. Hows that for versatility?
Re: Some handy scripts
Thats pretty sick!
I'll try and update that thread
I'll try and update that thread
Re: Some handy scripts
Anyone care to update jlv's .jm export script to work in v2.61 blender? They've changed the addon installation info and I can't figure out how to get it working.
Those who possess strength have also known adversity.
Re: Some handy scripts
Use this one:
http://mxsimulator.com/scripts/jm_export_25.py
http://mxsimulator.com/scripts/jm_export_25.py
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Re: Some handy scripts
Here are two python scripts that re-calculates the coordinates for trackfiles.
Thanks to WHEELS for testing and feedback.
Track rescaling script:
This one just re-calculates the coordinates for all trackfiles to fit a new scale in a user supplied new_terrain.hf file.
Link:
http://www.mediafire.com/?uwgsjue5zvr0a96
Instructions:
Track crop script:
This one re-calculates the coordinates for all trackfiles from a given set of crop values for the terrain.png, see the image below.
Link:
http://www.mediafire.com/?msits2s3o83j7a7
Instructions:
Thanks to WHEELS for testing and feedback.
Track rescaling script:
This one just re-calculates the coordinates for all trackfiles to fit a new scale in a user supplied new_terrain.hf file.
Link:
http://www.mediafire.com/?uwgsjue5zvr0a96
Instructions:
- Make a new terrain.hf file with the new scale in it and place it in the trackfolder.
- Run the script from the command line, either from the trackfolder or just enter the path to the trackfolder manually when prompted.
- The new trackfiles are now ready for use and the old ones have been saved with a *_old suffix.
Track crop script:
This one re-calculates the coordinates for all trackfiles from a given set of crop values for the terrain.png, see the image below.
Link:
http://www.mediafire.com/?msits2s3o83j7a7
Instructions:
- Run the script from the command line, either from the trackfolder or just enter the path to the trackfolder manually when prompted.
- Supply the crop values when prompted.
- The new trackfiles are now ready for use and the old ones have been saved with a *_old suffix.
-
- Posts: 4132
- Joined: Tue Oct 21, 2008 5:20 pm
- Location: Washington, USA
- Contact:
Re: Some handy scripts
....Manual Shape/Collision File Creator Helper Script Thingy For Blender....
http://www.mediafire.com/view/i7dfvb0ib ... creator.py
Steps: (Correspond to images below)
http://www.mediafire.com/view/i7dfvb0ib ... creator.py
Steps: (Correspond to images below)
- Open Blender with your object. Make sure Y axis is vertical (don't NEED to 'apply' rotation).
- Add a sphere (uv or iso). Place and scale in OBJECT mode.
- Add as many spheres as your heart desires. Scale them all differently if you feel so inclined.
- Open the text editor in a different panel.
- Open text block. Find and select the provided script. It will show up in the text editor.
- Select all your spheres and click "Run Script". You'll have to specify a filename (it should end in .shp)
- If you experience errors, turn on Blender's system console.
- You'll see an error message like this if you did it wrong. Otherwise it will say how many spheres were written.
- Open the file in notepadd++ (or whatever you use). Find and replace friction_coefficient, spring_constant, and damping_coefficient with your desired values.
Re: Some handy scripts
Cheers WHEELS, now the track fencing will have extremely annoying collisions for the rest of the GP-series...
-
- Posts: 4132
- Joined: Tue Oct 21, 2008 5:20 pm
- Location: Washington, USA
- Contact:
Re: Some handy scripts
....Banner Maker Helper Thingy For Blender....
http://www.mediafire.com/download/1b6pb ... .banner.py
Steps: (Correspond to images below)
http://www.mediafire.com/download/1b6pb ... .banner.py
Steps: (Correspond to images below)
- Open Blender and import the terrain mesh. This is kinda complicated. I think Haggqvist documented it somewhere...
- Go to top view (7 on numpad). Were going to use Z as up, and convert when we export the JM. Add a bezier curve. Extrude, scale, rotate as needed in EDIT MODE.
- Subdivide the life out of that bezier curve. The more subdivisions, the closer to the specified width the fence sections will be.
- Alt + C and convert curve to mesh. Check the 'Keep Original' for safety.
- Open text editor. Find and select the provided script. Load it. It will show up in the text editor. You can change FENCE_WIDTH and FENCE_END_PRECISION to suit your needs (I use 10 feet for the nationals fencing, then 80 or 90 percent is fine).
- Go to object mode. Select the bezier curve. Click 'Run Script'. Open the system console if there are errors.
- Set your snap settings like this. Still in the top view, select the new mesh, go to edit mode, select all verts, move in the Z direction (G, Z), hold ctrl and click on the terrain mesh. This should snap all verts to the mesh.
- Extrude the line of verts vertically. You have a line of banners. UV map as required for your banner skin.
Re: Some handy scripts
If you do that, try to break it up into multiple objects. One object with hundreds of spheres will be much slower than 10 obects with 10 per object since the bounding sphere test is per object.haggqvist wrote:Cheers WHEELS, now the track fencing will have extremely annoying collisions for the rest of the GP-series... :lol:
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Re: Some handy scripts
I love you Wheeler.
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
Re: Some handy scripts
It was mostly a joke as I probably won't have time to get it done for the tracks this year but cheers for the heads up.jlv wrote:If you do that, try to break it up into multiple objects. One object with hundreds of spheres will be much slower than 10 obects with 10 per object since the bounding sphere test is per object.haggqvist wrote:Cheers WHEELS, now the track fencing will have extremely annoying collisions for the rest of the GP-series...
I really wish there was time for it though as it would be a really handy way of keeping people on the track without littering the things with zillions of bales.
On the tech side; as it is now the fencing is split up into 14 parts for the GP-tracks, i.e. one .jm placed at 0,0 for every banner texture.
Would the collision testing be faster if the fence objects where split up even further e.g. with a separate .jm for every single continuous segment that has the same texture?
My idea was to place 2-4 spheres along the top edge of each fence segment and set up the collision values so that it's fairly easy to go across it at slower speeds while still making you crash when you run into it at higher speeds and lower angles of intersection.
Thank you for taking the time to finish this!ALL CAPS WHEELS wrote:....Banner Maker Helper Thingy For Blender....
However, I would just like to add that since the release of Blender 2.64 it's really easy to import terrains and there's no need for the gamma-related voodoo of old.
There are now options for setting the color space for a texture in the texture panel i.e. it's now possible to use the source terrain.png from the trackfolder directly as a heightmap for the displacement modifier.
This is really handy because the .blend file for the terrain can now be set up at an early stage since all changes to the terrain.png will be updated automatically.
Here's a screenshot of the texture panel option, just set the value to linear.