Menu

LEX File Exchange
EA Support Files
SC4 Wikipedia
Network Addon Mod
Dependencies
Chat

Author Topic: Using Blender (open source modeling program) for content creation.  (Read 19258 times)

0 Members and 1 Guest are viewing this topic.

Offline vortext

  • Administrator
  • Forums Guru
  • *
  • Posts: 3361
  • Total likes: 569
  • Reputation: 23
  • CL:
    Street Smarts
Re: Using Blender (open source modeling program) for content creation.
« Reply #60 on: January 27, 2019, 10:43:19 AM »
Yeah I tried to those zoom ratios, however, they seem intrinsic to how gmax / max handles things and appear to have little use in Blender. For example here's the zoom5 camera with an orthographic scale of 8;



Likewise applying a scale factor of 292 is way too much. And keep in mind pulling the camera back makes absolutly no difference to how much of the model is in the camera viewport (nor does changing the rendered output dimensions btw). As said, the orthographic scale is similar to zoom but not quite the same.  &mmm

Guess the question is; if the gmax /  ingame cameras are pointed down towards the ground, what are the dimensions (in meters) of the surface area captured? At least if I understand correctly this should correspond to the orthographic scale used by Blender.
« Last Edit: January 27, 2019, 10:52:33 AM by vortext »

time flies like a bird
fruit flies like a banana

Offline mattb325

  • BSC Team
  • Forums Parliamentarian
  • *
  • Posts: 1616
  • Total likes: 5271
  • Reputation: 25
  • CL:
    SC4D Housing Authority
Re: Using Blender (open source modeling program) for content creation.
« Reply #61 on: January 27, 2019, 02:03:57 PM »
These are very interesting discoveries!

Does this help any with the camera render scale? Note: Maths and I aren't friends, so I could be completely off-piste $%Grinno$%

-- set camera fov large enough so width of building appears in view
      renderFov       = 2 * (atan (targetWidth2/curCam.Target_Distance))
      
      if usingThumbnailCam then
      (
         renderWidth    = (146 * 2.0 * targetWidth2)/(cellMaxX - cellMinX)
      )
      else
      (
         renderWidth    = (zoomSizes[curZoom] * 2.0 * targetWidth2)/(cellMaxX - cellMinX)
      )
      renderWidth    = ((renderWidth  + 0.5) as integer)      -- round off
      renderHeight    = (((meshMaxY + viewportSlop)/targetWidth2) * renderWidth)
      renderHeight    = ((renderHeight + 0.5) as integer)      -- round off
      
      renderScaleX    = (0.5*curCam.Target_Distance) / targetWidth2
      renderScaleY    = (renderWidth * renderScaleX) / renderHeight
      
      true

Offline rivit

Re: Using Blender (open source modeling program) for content creation.
« Reply #62 on: January 27, 2019, 02:25:29 PM »
@vortext

 You've made great progress - this is starting to look a lot better every time you post - do you feel like an explorer in 1492 yet?

@mattb325

  yes I recognise those - fundamental unwrapping of the 3D projection back into 2D.

 

Offline vortext

  • Administrator
  • Forums Guru
  • *
  • Posts: 3361
  • Total likes: 569
  • Reputation: 23
  • CL:
    Street Smarts
Re: Using Blender (open source modeling program) for content creation.
« Reply #63 on: January 28, 2019, 07:46:30 AM »
Yeah that helped Matt as I managed to get confirmation about the orthographic scale.  :thumbsup:

First I calculated the fov according to script, using a targetWidth2 of 24 (composed of mesh width 16, and viewportSlop 8 as defined) and Target_Distance of 190. Next using the fov angle and known camera height in the Blender scene (142.35) I calculated the length of the opposite side of an imaginary triangle, as if the camera was looking down, which came out as 36.54528. Very close to what I arrived at manually indeed (and btw the hypotenuse of this triangle is 146. . ).

However this seems a bit roundabout way of getting the scale, seeing the orthographic camera in Blender does not have a field of view property (and which appears to be different from max as the render camera does have a fov set, however, orthoProjection is set to true as well). Besides it still leaves the camera offsets and output dimensions to be calculated as well. . so yeah..  &Thk/(

However looking over the entire script a few times I got a vague idea of the steps involved rendering a model of arbitrary size, so I'll have to do some digging in the Blender api and refresh my trigonomy to figure things out.


Also note to self: do not give the export from Blender a filename starting with 'lod' as this will somehow cause gmax to actually wipe it from the scene .. was a fun half hour figuring that out  &sly

btw Ron tbh I'm starting to feel more like this . . the angles and the scale..  it's, like. . all related man   :D
« Last Edit: January 28, 2019, 09:58:00 AM by vortext »

time flies like a bird
fruit flies like a banana

Offline rivit

Re: Using Blender (open source modeling program) for content creation.
« Reply #64 on: January 28, 2019, 04:29:14 PM »
"the angles and the scale..  it's, like. . all related man"   Yeah I know exactly what you mean. A lot of the time its "miracle occurs here" until something drops into place.

https://cellcode.us/quotes/miracle-occurs-here-cartoon.html

If I can help in some way don't hesistate to ask - perhaps I should download Blender and see if I can parallel your efforts so we have notes to compare? Im a bit of a noob with modelling programs though.

Offline fantozzi

Re: Using Blender (open source modeling program) for content creation.
« Reply #65 on: February 03, 2019, 06:21:58 AM »
Yeah, to clarify, the prob i'm having isn't importing the model; it's successfully applying the textures i baked in Blender. Has anyone managed to do this? I baked a texture map, but I can't seem to get Gmax to import the UV map from Blender w the 3ds file, and even if I do manage to get the map into Gmax (via exporting from Blender as a .obj file), the baked textures don't seem to follow the map and thus show up on the model as a giant mess. Ugh.

And eggman, your method sounds fascinating, but it's well beyond my experience at this point!

If I export 3ds from Blender, most of the time it doesn't work in gmax for me ("improper format" or so).

You may try this:

a) download this converter written with gmax in mind (by a ms flight simulator fan): https://www.scenerydesign.org/modelconverterx/
b) from Blender export to *.dae format
c) import the dae into the model above converter and export as 3ds.

Please tell me if this works for you too. Thanks.
« Last Edit: February 03, 2019, 06:27:40 AM by fantozzi »
We suffered for our art. You have to suffer for our art as well!”
(Terry Gilliam)

Offline vortext

  • Administrator
  • Forums Guru
  • *
  • Posts: 3361
  • Total likes: 569
  • Reputation: 23
  • CL:
    Street Smarts
Re: Using Blender (open source modeling program) for content creation.
« Reply #66 on: February 10, 2019, 08:17:31 AM »
If I can help in some way don't hesistate to ask - perhaps I should download Blender and see if I can parallel your efforts so we have notes to compare? Im a bit of a noob with modelling programs though.

As been said this would be a good time to try out Blender for sure, though couple of things to keep in mind. First it still is quite a daunting piece of software to navigate as it is capable of so much more than just modelling (animation, simulation, fx, post processing, etc) so be prepared for lot of 'which damn menu was this thing again. .' 

Secondly, the new version does introduce an unwanted side-effect in that if you search for 'how do I do this specific thing in blender' around 95% of the results are for older versions. Some of these will be applicable 1:1 with the new version, other results will be completely useless. For example something as simple as changing the major gridlines in the viewport took me more searching around time than it should (it's now in the overlays menu btw ). So this can be tad frustrating, but of course this will change over time as more and more people adapt to 2.8

At any rate, I'm confident the scaling can be resolved one way or another. Either by doing it in the roundabout way of calculating a fov first, then somehow fitting it in camera view. Or by taking a cue from the (g)max scripts and using transform & camera matrices to work things out.

Either way both solutions wil need a proper functioning add-on to make use of, so that's what I decided to focus on for the time being. Shown below first glance at the add-on located in the 'output' context menu, which I figured was appropriate. Besides is isn't as cluttered as some of the other context menus so scrolling is kept to a minimum.  :)




Next thing will probably be figuring out how to handle rotations. I noticed the (g)max script actually seems to rotate the camera (and I presume lighting) around the object. However at the moment I'm thinking to rotate all the scene objects around the world origin, as this functionality could potentially also benefit making diagonal and far renders. Moreover I'll need to go over all the scene objects anyway in order to fit the LOD. So yeah, lots of details to be hammered out still.  :-\
« Last Edit: February 10, 2019, 08:59:13 AM by vortext »

time flies like a bird
fruit flies like a banana

Offline rivit

Re: Using Blender (open source modeling program) for content creation.
« Reply #67 on: February 10, 2019, 05:01:16 PM »
Thanks for the tips - I have downloaded it and taken a look and I agree its like standing in a blizzard looking for a particular snowflake. At least I don't have the advantage? of having seen previous versions.

However I did also take a look at the manual for scripting and it appears nearly all of the internal data model is available with appropriate code. I'll need to wrangle the language first.

I've given myself the project of seeing if I can make an action panel based on one we know well from (g)max and see if I can gradually hang things off that. At least once its set up I won't have to look about as much. Your example is the sort of thing I had in mind. Then I will also have got a bit of a grip on the syntax and feel of a tiny piece of the data model.

However at the moment I'm thinking to rotate all the scene objects around the world origin, as this functionality could potentially also benefit making diagonal and far renders. Moreover I'll need to go over all the scene objects anyway in order to fit the LOD.

I ended up here in thinking too - since SC4 always uses the same lighting regardless of viewpoint rotating the model should work. (although given its under a button in the end its probably just as easy to rotate cam and lights)

And then of course the script sort of reduces to

for day &/or night
   set environment
   for zoom is 4 downto 0
       set projection     
       for rotation is 0 to 270 by 90
          setup render and orient
          render, slice'ndice, number things, make fsh, project LODS, make s3ds, save the bits
     next rotation
  next zoom
next

easy?  nope. Each word is like an explosion - gets big fast.

~~~
A question - can you set Blender up to be/work in Left Handed, XZ base plane, Y pointing up Coordinates ie in DirectX mode a la SC4, or is it Righthanded XY baseplane, Z up only?
 

Offline tomvsotis

Re: Using Blender (open source modeling program) for content creation.
« Reply #68 on: February 10, 2019, 07:01:47 PM »
If I can help in some way don't hesistate to ask - perhaps I should download Blender and see if I can parallel your efforts so we have notes to compare? Im a bit of a noob with modelling programs though.

As been said this would be a good time to try out Blender for sure, though couple of things to keep in mind. First it still is quite a daunting piece of software to navigate as it is capable of so much more than just modelling (animation, simulation, fx, post processing, etc) so be prepared for lot of 'which damn menu was this thing again. .' 

Secondly, the new version does introduce an unwanted side-effect in that if you search for 'how do I do this specific thing in blender' around 95% of the results are for older versions.

Yeah, that's def true. I've gotten pretty good w Blender over the last couple of years; if there's anything specific you're struggling with, feel free to ask, and maybe I can give you the answer?

Offline tomvsotis

Re: Using Blender (open source modeling program) for content creation.
« Reply #69 on: February 10, 2019, 08:45:27 PM »
*snip*
Please tell me if this works for you too. Thanks.
Thankfully, I've managed to get a copy of 3ds Max since then, so I haven't had to worry about exporting from Blender to Gmax. If it's any help, exporting from Blender as an .fbx and importing that into 3ds Max works pretty much flawlessly. (The exception is curved surfaces, for which there is a workaround that involves flipping the normals on the object and then adding a Normal modifier to flip them back agin. I have no idea why this works, but it does.)

Offline Jasoncw

Re: Using Blender (open source modeling program) for content creation.
« Reply #70 on: February 11, 2019, 10:39:43 PM »
BAT handles the various rigs by linking them to a helper object ("TB2CameraHelper" or something like that), which everything else is linked to. Right now in BAT4Max the cameras are in their own scene(because the cameras never change) which is xreffed, and linked to the helper object. The lights used to be separate from the scene as well, but now they're within the scene itself, because they're constantly getting changed to switch between day and night(s).

So in BAT, when you change the rotation, the only thing it's doing is rotating one object, the helper object. If there's an equivalent in blender, the lights and cameras should be linked to a helper object, and that way you just need to rotate that one thing every time. Rotating the entire scene is more prone to introducing problems. What if all the building parts get rotated inconsistently? Or when you rotate the view for a preview render, does that change which facades show up in each viewport, and which parts of the building correspond to which axis directions changes every time you want to do a different preview render?


FAR and diagonal BATing could be approached different ways. I don't think an export setting would be as useful here, because when you make these buildings you usually need to customize them a lot first. It's not just a matter of it needing to be rotated, unless the building is completely freestanding and doesn't line up with roads or anything. The difficulty of those things is having to work both diagonally and orthogonally at the same time for different parts of the building. In 3ds Max, it's possible to create grid objects (which you could then rotate, so you could have your normal grids and viewports but also have grids/viewports for your FAR/diagonal facades), and having buttons to press to create those automatically would be useful, if that exists in blender.


Unfortunately, while I have some memory of BAT4Max getting developed, the most I've ever done myself are very very simple edits. I've also never used blender before. But when it comes time, I can help out more directly by helping to put together good lighting and rendering settings with the new renderer, so that things look good, match well, and are hopefully fast to render.
« Last Edit: February 11, 2019, 10:42:54 PM by Jasoncw »

Offline rivit

Re: Using Blender (open source modeling program) for content creation.
« Reply #71 on: February 13, 2019, 04:02:12 PM »
The (software) engineer in me has found a need to specify what I'm doing:

Bat4Blender

Goal:
Using the Blender Application, to be able to produce .SC4Model files for rendered 3DModels, compliant with the parameters demanded by the SimCity4 application and with final outputs as produced by the gmax BAT tool.

Functional Specification v1.0 rivit
Art Features:
   To take advantage of the Blender Application Rendering capabilities to produce art compatible with SimCity4
   + advanced application dependent rendering techniques
   + control of exposure, color gamut, shadows, etc etc
   
   Legacy Compliance with SimCity4 and derived works
      - produce Buildings/Props and Foundations
      - SC4 Standard calibrations e.g. Sun and Shadows, Day, Night
      - Maxis Variable Night  i.e. Day with Night renders a blended overlay
      - BAT4Max v6? fixed DarkNight (or a variable equivalent) Day and Night both fixed renders.
         - MN is inconsistent with Maxis Night colors and should be dropped (is not functionally relevant if we can make a Variable Maxis night)
      - High Definition renders of Zooms (3,4),5 in addition to Standard Rendering

   Desirable
      + add support for baked textures for Automata

Technical Features:
   Simple dedicated application Tool Panel which controls all aspects of the BAT production
      should look/act like the gmax BAT panel
      
   Setup/Manipulation of Camera, Lights for Day and Night(s).
      Do we really need 6 cameras? or just camera settings according to Day/Night/zoom/view/resolution/renderstyle
      
   Produce automatic LODs of models for zooms (3,4),5 - preferably close-fitting accurate shells
   
   Support manually created LODs
   
   Legacy Compliance with SimCity4: must produce like outputs from gmax BAT.
      Support for randomised or manually entered GID
      To Produce Render and Package a .SC4Model file comprising
         4 Views and 5 zooms of each Model, Day and optionally Night
         Correctly TGI numbered components
         up to 64 panels per Model view at max zoom (SD or HD)
         FSH of the rendered model - DXT1 for Day, DXT3 for Night
         S3D files of the segments of the rendered LODs of the model
         Thumbnail Images

   Desirable:
   + Add support for exporting (s3d) of Automata and their Textures (DXT3)
   
Notes:
   This custom application for Blender v2.8 and following, is largely a porting operation from gmax BAT scripts, with all internal gmax program/function references taken up by Blender/Python equivalents. The gmax Scripts comprise 7000 lines of code - even at only at 5 min per line (understand, translate, test) this is 600 hours of code translation.

   There is a large language difference between gmax script (BASIC-like) and Python, although functionally the latter is likely to be richer given the age of gmax. The current scripts are very bound to gmax, rambling, untyped, not fully qualified and hence ambiguous to some extent - I have started (20% in) to port these (original gmax BAT) to VB.NET so that they can be at least checked for completeness by compilation. This allows me to separate script-only code from internal gmax functions which need to find Blender equivalents. Eventually it gives me a baseline protoype app shell independent of gmax which should make it easier to subsequently recode into Python (by someone who can). (Needs someone who knows the Blender API well)

   However, since we need to make such a large transition in code, we are not obliged to keep all features or methods applied in gmax, nor even functional constraints as long as we produce Simcity4 compliant outputs. Hence simplification should be a catch-cry wherever we can. Also newer techniques now exist for some things e.g. Does anyone use the old nightlighting techniques in gmax BAT? Making detailed LODs automatically should be easy nowadays with Shell Mesh functions.  We should take advantage of this if we can. (Needs someone who knows Blender well)

   Also, I'm not sure that all of the "parameters" of BAT are in the scripts - where are the art things actually defined? Documented? There are some things done outside of the script by MAXIS code I think - not clear yet. 
      
It's a project, Jim, but not as we know it

   It's a big project however you look at it. If it is to succeed in a useful timeframe it will need a lot of interaction and communication and a team of about 10 (not necessarily concurrently), split into
         Art/Technical types,
         Blender/Max types,
         Python/BASIC types,
         Experimental/Structural types,
         Starter/Finisher types.
         Document/Test types
         
   There needs to be a lead on Art, one on Technical and one on Prototyping/Testing.
   And Someone in charge of the charge.
      
  The work should proceed from the Art (Blender) towards the production of Correct Render and LOD, the technical from outputs backwards (from SC4) to there. This allows for a synch point. There is an overlap where technical control of the app is needed to produce the art - Menus, Rigs, Command Buttons etc. hence coordination will be necessary. We will have to bootstrap up from Prototyping to Structured development - its a LEGO challenge.
      
   This is a project equivalent in complexity to a NAM release that revises legacy with something new (think Flex replacing Puzzle Pieces) - will need the same dedication, perserverance and patience - is it worth doing? or are we too late? can we get this sort of team to stick? can we find enough of the right talent? real volunteers?
      
   please discuss and refine (what is missing?, what can we drop?). I will collate specification items.
      

Offline tomvsotis

Re: Using Blender (open source modeling program) for content creation.
« Reply #72 on: February 13, 2019, 08:39:19 PM »
Damn, you can manage one of my projects any time!

I'd love to help however I can. My previous posts in this thread were made when I .... well, I had no idea what I was doing, tbh. Now that I've actually used the existing Bat4Max, I have a better handle on how the process works and what the scripts actually need to do. I'm not a programmer, unfortunately, but I am fairly familiar with Blender and how it works, having used it to model and export several buildings that I rendered with 3ds Max.

I've also done a fair bit of experimentation with Cycles Render -- before I got 3ds Max, I textured and rendered several models in the hope of being able to bake textures etc and import them into gmax to render as .SC4Models. (That didn't work, sadly -- I couldn't get gmax to successfully import the baked textures and UVs, which is what one of my previous posts here was about.) But yeah, I have a pretty good understanding of how to texture models and how to fiddle with Cycles' settings to produce something that looks reasonably BAT-ish.

Offline mattb325

  • BSC Team
  • Forums Parliamentarian
  • *
  • Posts: 1616
  • Total likes: 5271
  • Reputation: 25
  • CL:
    SC4D Housing Authority
Re: Using Blender (open source modeling program) for content creation.
« Reply #73 on: February 13, 2019, 08:46:28 PM »
Happy to help, Ron, if you need me  :)

Offline rivit

Re: Using Blender (open source modeling program) for content creation.
« Reply #74 on: February 14, 2019, 09:44:43 PM »
Thanks Tom and Matt, I really appreciate your replies, and will take advantage from them  ;D

 Tom : given you've had more Blender experience that most of us some things that would be useful to know:

a) How do you record Macros and get them out of Blender into a script? Using macros tells us a lot about how to code the scripts later and may save us quite a bit of coding. Its a trick I use in Excel when I havent got a clue how to code something - recording actions as a macro and then editing it is easier than inventing it from scratch.
 
b) How do you make/automate LODs in Blender? - given in Max they're just Bounding Boxes, but we'd like better than that


 Matt: given your experience in Max and deeper understanding of BATing techniques in general and you've just gone through a full install and calibration of Max2017

a) can I have a copy (zip) of the BAT gamepack folder for BAT4Max as it is in your setup, please. I dont have 3dsMax at all. You probably have the most recent completely working BAT4Max setup that I know of. I can then compare these scripts (and executables) with the gmax scripts to see exactly whats changed over the years and also figure out more of how Bat4Max works. Some snapshots of the tool Rollout would also be useful.

b) would you consider the following idea for a reference BAT. Imagine something one could put to use in-game but that anyone can primarily use to test the scripts and strengths/weaknesses of gmax, Bat4Max and Blender (eventually). Also it might help people calibrate/improve their color setups.   

It should be:
 
  • smallish, somewhat asymmetrical , say 3x2 textures, so as to trigger the slice and dice in the script
  • night lit using modern methods to test the day and night rendering quality, shadows, transmitted light and cast light
  • tricky enough geometry to stump default LODs and hence need custom LODs and exercise the Ray tracing well
  • exportable to gmax, Blender (I don't know what it accepts)
  • renderable in gmax, Max and Blender (we have no data to compare).
  • If its got a few snafus in textures/colours that would be good too - say sharp edges, contrasts, patterns

Of course, you may actually already have one you prepared earlier given a number of your recent FAR (out) productions.
   
 cheers (its Friday)  Ron
« Last Edit: February 14, 2019, 10:24:08 PM by rivit »

Offline fantozzi

Re: Using Blender (open source modeling program) for content creation.
« Reply #75 on: February 15, 2019, 01:34:43 AM »
Can it be we were eye witness of the birth of the ...

... Blender Gang?

 ()meeting()

Exciting.
« Last Edit: February 15, 2019, 03:45:04 AM by fantozzi »
We suffered for our art. You have to suffer for our art as well!”
(Terry Gilliam)

Offline vortext

  • Administrator
  • Forums Guru
  • *
  • Posts: 3361
  • Total likes: 569
  • Reputation: 23
  • CL:
    Street Smarts
Re: Using Blender (open source modeling program) for content creation.
« Reply #76 on: February 15, 2019, 07:33:30 AM »
Damn, you can manage one of my projects any time!

Yeah no kidding, I've got a few projects laying around which would stand to benefit from such analysis!  :D

Thanks for the breakdown(s) Ron, and also thank you Jason for your input. I've wondered what those handlers were exaclty. Also hadn't thought about the positioning issue when rotating models, and given the other issues you mention it may indeed be more beneficial to rotate the cameras & lights instead. I'll have a look around if Blender has similar capabilities for linking objects together in a scene.  :thumbsup:

The current scripts are very bound to gmax, rambling, untyped, not fully qualified and hence ambiguous to some extent - I have started (20% in) to port these (original gmax BAT) to VB.NET so that they can be at least checked for completeness by compilation. This allows me to separate script-only code from internal gmax functions which need to find Blender equivalents. Eventually it gives me a baseline protoype app shell independent of gmax which should make it easier to subsequently recode into Python (by someone who can). (Needs someone who knows the Blender API well)      

This is really excellent, because the (g)max scripts seemed a bit incoherent indeed. I figured it was my lack of knowledge regarding the scripting language and gmax in general which made it seem that way (though chunks of commented out code in a 'production' environment are never a particulary good sign . .). At any rate, while I do not know the Blender api well (yet) it's just a python library and by now I do know python well enough to make use of it.  :)


However, since we need to make such a large transition in code, we are not obliged to keep all features or methods applied in gmax, nor even functional constraints as long as we produce Simcity4 compliant outputs. Hence simplification should be a catch-cry wherever we can.

Yes, this I feel is quite paramount to keep in mind for the time being as your outline, while comprehensive and feature complete, is quite daunting because of it. Yes custom lods, nightlights and tgi generation wrapped up in an automated process which executes with a simple button press would be very nice to have in the final end result. However if I understood Robin's post here correctly the majority of these steps can be taken care off manually with already existing tools.

So I guess another way of putting it is I think the analysis could benefit from prioritisation of what goes into the proof of concept, or the minimal viable product, or however one wants to call the thing where a dozen manual steps are still needed to get the desired result.   

Friday indeed, plan on some tinkering time over the weekend. If it wasn't obvious already I'm the experimental starter type.  :D

~~

already got some tinkering in and have Blender auto-completion working in pycharm and found a way to run external files from within Blender. The latter is really nice as the native text editor leaves a lot to be desired, to put it mildly. Also made a github repo, though the project structure is likely to change. 

A question - can you set Blender up to be/work in Left Handed, XZ base plane, Y pointing up Coordinates ie in DirectX mode a la SC4, or is it Righthanded XY baseplane, Z up only?

yes that's possible, however, I'm not sure if changing the axis of an already existing blend file will affect the model, or have unwanted side effects otherwise. So perhaps it's best for now to leave it at default orientation as I reckon the majority of users and blend files available from share sites will probably use the default. And from my limited experience thus far with the exported .obj the defaults works fine when imported into gmax. 

« Last Edit: February 15, 2019, 05:00:29 PM by vortext »

time flies like a bird
fruit flies like a banana

Offline mgb204

Re: Using Blender (open source modeling program) for content creation.
« Reply #77 on: February 15, 2019, 01:10:18 PM »
However if I understood Robin's post here correctly the majority of these steps can be taken care off manually with already existing tools.

Once we've rendered BMPs, provided the script can pass the right data along, we can make use of the same image conversion/importing process used by BAT4Max. When exporting the LODs, they will be imported into gMax (SC4 BAT), which will give our model an ID.

So if we follow the BAT4Max process, i.e. selecting that model file when rendering. It can pick up the ID from the SC4Model filename? In essence, everything is handled inside Program Files\Autodesk\3ds Max 20##\gamepacks\BAT. Once you've rendered at least one model using BAT4Max, what resides there is pretty straightforward to understand. I've attached a sample .BAT file, which uses DatCmd / fshwrite as command line tools, for reference. So long as the Blender scripts can create/run the script, and place the rendered images into a similar folder setup, all the post render stuff is taken care of. Again, I think you'd want to mimic however BAT4Max handles this process, how straightforward that is, I can't say.

Offline mattb325

  • BSC Team
  • Forums Parliamentarian
  • *
  • Posts: 1616
  • Total likes: 5271
  • Reputation: 25
  • CL:
    SC4D Housing Authority
Re: Using Blender (open source modeling program) for content creation.
« Reply #78 on: February 15, 2019, 04:32:15 PM »

a) can I have a copy (zip) of the BAT gamepack folder for BAT4Max as it is in your setup, please....... Some snapshots of the tool Rollout would also be useful.

I've sent you a link for the file. I've also left the output files for the last several Bats that I have shown. While none has custom LODs, they may fit the bill, or just at least be useful as a reference.

The tool rollout is relatively similar in feel to gmax. There's a couple of extra features. It's in the utilities Maxscript area:


Clicking on each header reveals further options:







b) would you consider the following idea for a reference BAT. Imagine something one could put to use in-game but that anyone can primarily use to test the scripts and strengths/weaknesses of gmax, Bat4Max and Blender (eventually). Also it might help people calibrate/improve their color setups.   

It should be:
 
  • smallish, somewhat asymmetrical , say 3x2 textures, so as to trigger the slice and dice in the script
  • night lit using modern methods to test the day and night rendering quality, shadows, transmitted light and cast light
  • tricky enough geometry to stump default LODs and hence need custom LODs and exercise the Ray tracing well
  • exportable to gmax, Blender (I don't know what it accepts)
  • renderable in gmax, Max and Blender (we have no data to compare).
  • If its got a few snafus in textures/colours that would be good too - say sharp edges, contrasts, patterns


Here's one I just started. In the output files that I have sent you only one has transparency. So with this model I intend to give you transparency, custom LODs, foliage, both procedural and bitmap textures. The works. I can also add a 45 or 90 degree angled piece at the base if you want.



Whatever you think will help.

It must be noted that the way I model is really peculiar to me. Apart from Alex - xannepan - I don't know anyone else who uses these methods, which, for square buildings is mostly just lines/splines. Only when I need to do anything more complex or organic do I collapse to mesh or polygons. But both of which slow me down intensely (we are talking the difference between seconds to model, say a wall, with lines and days to model it with polygons).

Later I can collapse these if we run into issues. But it is something to bear in mind.
« Last Edit: February 15, 2019, 04:43:41 PM by mattb325 »

Offline rivit

Re: Using Blender (open source modeling program) for content creation.
« Reply #79 on: February 15, 2019, 06:06:11 PM »
Working Backwards

Thankyou Matt - package received - a quick look suggests that BuildingMill has grown by 1000 lines of code (65%) to 2500 lines. Ironically many of the 128 changes are removing old commented code so the change is actually bigger.  The camera Rig is almost the same - just 31 changes. Pics of rollout are now in the archive.

Progress report: I have found that about 500 lines of code in the old gmax scripts are either dead or unused.

The building is quite the things I had envisaged. My logic is such - if Blender can't actually match Bat4Max in outputs then we need to find out where, how to compensate and make a decision if its worth it. Same goes for handling imports/exports. To get there we need something to compare with. The gmax bit is so that we have target files with which to compare the outputs into SC4, as Bat4Max produces files that are 2x larger than gmax to start with.

This should also give the creator types something to get their teeth into as far as render settings etc. So thank you so far - brilliant, and I'm sure the Engineering Dept will find good use.

TODO: for someone - nail down what Blender/3dsMax/gmax/ (Reader takes .3ds) can actually exchange with each other. Not just file format - but content within - including textures, uvw etc., settings, any exotics like splines, NURBs, lights, scenes.  Document (with examples) and make available. This is independently needed as useful info, and crucial to data exchange between tools - esp. for testing.

@Robin (MGB) Yes that why the synch point is Render and LOD. If the first part works, and the existing facilities can be used to get outputs into SC4,  then we can bootstrap the second later. Having said that getting the renders is still a big unknown.

@Fantozzi - like it - next you'll be telling me our theme tune should be "Life in the Fast Lane"

@vortext
Thanks for all off your additions/alterations, the name of this Product and the GitHub Repo. It's good news you're getting good with python as we're definitely going to need it, while for me its readable but very weird. And yes I'm very conscious of this not becoming a Ben Hur - the faster we get something working the more likely we are to finish it or conclude its not worth it.

btw Our Oz SBS TV broadcaster is showing the original Monty Python series (this time its in color!), it being 50 years ago today, that they first surfaced. I was 14 at the time, and I'm amazed at how much I still remember of it - it clearly seared into my brain