Code Monkey home page Code Monkey logo

nifskope's Introduction

niftools.github.io

Installing Locally

Prerequisites

You need to install Ruby. After you install Ruby you can simply install Bundler: gem install bundler

Then to get the necessary gems for the site you run bundle install from the project root.

You will most likely get an SSL error while trying to build so you need to grab http://curl.haxx.se/ca/cacert.pem then install it anywhere (e.g. Ruby folder) and add it to your PATH.

OPTIONAL If you want to edit or create posts more easily (instead of by hand), you can uncomment - jekyll-admin in _config.yml to use the admin interface at localhost:4000/admin. This change does not need to be committed as jekyll-admin is local only. I would recommend leaving it otherwise commented as it appears to disable file watching while editing the site design.

OPTIONAL If you are ever designing new pages and need to change \bower_components in order to add package dependencies you will need to install Node.js/npm. You must then install Bower with npm install -g bower. From there you can add Bower packages to the project root's bower.json and then run bower install or you can run bower install <package>.

Building and Running

To build the site locally you run jekyll build. To serve the site locally you can run jekyll serve. This will serve from localhost:4000 and will watch for any changed files so that changes will show up as you make them.

To view what the site would look like with the posts in _drafts published you can run jekyll serve --drafts.

Front-Matter

Jekyll will parse any file with front matter at the very beginning of the file. Empty front matter looks like so:

   ---
   ---

You can also include the following variables:

Variable Description Format
layout: Which template to choose in _layouts. default, page, post
title: Text which shows in the webpage title and also the jumbotron <string>
date: Used to sort a post in chronological order. Also used in feed.xml. YYYY-MM-DD HH:MM:SS +/-TTTT
category: What category your post belongs in. <string>
categories: What categories your post belongs in. [<string>, ...]
tags: A list of tags relevant to the post. [<string>, ...]
excerpt: Text which shows in the page meta description. If used in a post it will act as the synopsis on the front page. <string>
subtitle: Text which shows under the title in the jumbotron. <string>
menu: Which navbar item is to have the class selected <string>
toc: Whether this page should have an auto-generated table of contents. true | false
geopattern: A custom string input for the jumbotron SVG background. Otherwise it uses title: <string>
navbar: Used to override the navbar style for this page. navbar-inverse navbar-inversed
css: Custom CSS to include on this page. Must install to /assets/css/ but only list the filename. [<string>, ...]
js: Custom JS to include on this page. Must install to /assets/js/ but only list the filename. [<string>, ...]

A common example of front matter for a post would be

---
layout: post
title:  "Example Post"
date:   2017-05-10 13:25:35 +0200
categories: nifskope releases
---

Publishing

To avoid publishing manually, you may use jekyll-admin if you have uncommented it in _config.yml and restarted jekyll. The admin interface will be available at localhost:4000/admin. You can include custom front matter variables in the field below the post text.

Posts

Placing any Markdown or HTML file in _posts with valid front matter will publish the file to the site. Where it goes will depend on the front matter such as the layout and what categories are listed. A post layout with categories: nifskope releases will get published to /nifskope/releases/.

Relevant Documentation

Categories

Most posts should likely consist of two categories: the project or main product name and a subcategory such as releases e.g. categories: nifskope releases or categories: blender releases. If posting about general developmental news or about multiple projects, use something like category: updates.

Pages

A page layout titled mypage.md will get published to /mypage if it is in the project root.

Relevant Documentation

nifskope's People

Contributors

alphax avatar amorilia avatar bobtedbob avatar darkyellow avatar hexabits avatar mharj avatar mikeshutlar avatar neomonkeus avatar nickdickinsonwilde avatar nicocoin avatar psi29a avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nifskope's Issues

Separate UI display from logic

Continuation of what is seen here: amorilia/nifskope#22

Enhancing and extending the UI will be easier if the current UI can be edited in Qt Designer/Creator.

There are customs when it comes to signals/slots for ease of UI separation that will need to be adhered to. Qt code expects that a slot shall be named on_<actionName>_<signalName>, so there would also need to be changes to the signal/slot code.

Tracking

Refactor Progress #32

"Create Convex Shape" enhancements

Multi-collision support

Create Convex Shape currently strips the root collision. Any collision generated should be put into its own NiNode as a sibling to the shape you are creating it for.

List of CVS

A user may want to create collision for the entire mesh, not just one NiTriShape. This could technically be done by creating a bhkListShape with a CVS for each NiTriShape.

Radius

The spell assumes a radius of 0.1, which is actually pretty high. A large amount of bhkCVS have a radius of 0.00, but the vast majority use 0.05.

I did a review of the CVS radiuses in Skyrim.

Best alternative is to allow user choice in the matter. Default to a value, let them change it. Then generate the CVS.

Skyrim Material: Int values not mapping to enums

The Skyrim Material on bhkMoppBvTreeShape is not being populated correctly on load. It has a value of 0. When selecting a new value, the enum mapping remains (it says SKY_HAV_...) and persists even after things like Reset Block Details.

Additionally, the Skyrim Material on the sub-block bhkCompressedMeshShape does not show the enum mapping, but the integer. When double-clicking to activate the edit box and clicking away, it resets this value to 0.

Also, when double clicking, the box is completely blank (why it likely resets to 0), until you click on the dropdown arrow to the right. If an Enum value is correctly displayed in the field, double clicking to edit will show the right index in the drop down (the current enum).

Examples:
~\meshes\architecture\orclonghouse\orcawning01.nif
~\meshes\architecture\farmhouse\farmhouse01.nif

Task List

  • Fix Skyrim Material on bhkMoppBvTreeShape blanking to 0 on NIF load. INVALID
  • Fix integer to enum mapping on bhkCompressedMeshShape. INVALID
  • Assure that even when an integer value is entered, it maps to the enum value on edit completion. CONFIRMED

Fill in README stubs

I've added CONTRIBUTORS and TROUBLESHOOTING readmes and they will eventually need to be filled out.

@neomonkeus if you could provide a list of current and past contributors, I can format it and get it committed.

Just going by the commit graphs:

@amorilia
@Alphax
@mharj
@PacificMorrowind
@darkyellow
@NicocoiN
@infectedsoundsystem
@bobtedbob

And others have probably contributed from before GitHub.

For TROUBLESHOOTING, it will mostly be taken from the previous readme for now, and deal with improving it later. The previous readme had this:

* Do not install nifskope whilst blender is running.

* Be warned that collada export is still very experimental. It may, or
  may not, work for you.

* On some graphic cards textures show up black or distorted. If this happens,
  uncheck "Shaders" in NifSkope's settings.

* Models with multiple texture maps may appear to be missing some textures,
  but they will become visible when some texture maps are disabled. This is
  due to the limited number of texture units in graphics hardware.

* If one of NifSkope's windows disappears due to moving it to a location
  outside of the desktop view, close NifSkope and remove the NifSkope settings
  by deleting the registry key(s)

    HKEY_USERS\S-1-5-***\Software\NifTools\NifSkope-***

  Launch NifSkope again, and all windows will appear at their default
  position.

* If NifSkope does not start at all, check your firewall. NifSkope uses the
  network (locally, nothing is sent to the outside world) to communicate with
  itself.

NifSkope.pro file cleanup

NifSkope.pro should be reorganized and restructured to better operate between platforms, individual machines, and compilers. Dependency management should be improved.

Issues.

  1. There is an incompatibility with the NIFSKOPE_VERSION and NIFSKOPE_REVISION macros between Qt Creator and VS 2010-2012. Also, VCPROJ files do not get generated optimally in addition to this macro formatting error. Visual Studio should be somehow targeted directly. (See Below)

  2. The following defines should be looked into:

    • USE_GL_QPAINTER
    • EDIT_ON_ACTIVATE (alt: Q_OS_WIN)
    • NO_MESSAGEHANDLER (alt: QT_NO_DEBUG)

    I would prefer to allow stats rendering on all builds, so USE_GL_QPAINTER could be done away with. Also, EDIT_ON_ACTIVATE may be a relic that is not even needed anymore.

Goals

  1. Use QT_INSTALL_BINS to find and copy DLLs to build folder when dynamic. Ignore when static.

  2. Copy shaders, lang folders to build dir.

    • Look at INSTALLS option
    • Alternatively copy to PWD_OUT with QMAKE_POST_LINK
  3. Create make targets for NSIS, docsys, doxygen, etc.

  4. Clean up the build dir significantly using UI_DIR, MOC_DIR, OBJ_DIR, RCC_DIR to put them in appropriate subdirs.

  5. Differentiate between MSVC builds by Visual Studio and those by Qt Creator. Checking for *msvc* scope does not do this alone, though one can test if the build is a "shadow build". Qt Creator builds outside of the project root by default. Visual Studio does not.

  6. Setting up 32-bit / 64-bit compiler scopes should be looked into. Qt precompiled libraries come in 32 and 64-bit. However, static compilation should be an option for Qt, and we should build our own 32- and 64-bit Qt libs to link against.

  7. Consider putting flags in place to enable C++0x / C++11 support for the compilers that can use it. Like 32/64bit code this would be just put in with the off chance that the source will utilize such features in the future. There are quite a few nice things about C++11 so it might eventually sneak into the codebase.

    See:

Task List

  • Clean up defines.
  • Make targets for docsys, doxygen, NSIS (Create its own ticket).
  • Split dependencies into their own config blocks.
  • Copy necessary files and folders to build directory.
  • Deal with static vs dynamic builds, e.g. copying DLLs to build dir.
  • Reorganize compiler/platform scopes. (Only minor work, later work needed)

Deferred Tasks (Will make future ticket)

  • Solve macro incompatibilities between Visual Studio and Qt Creator et al. Seems to have fixed itself?
  • Add Visual Studio specific code so that VC++ project files are created correctly. Seems to have fixed itself?
  • Lay groundwork for future 32-bit / 64-bit specific builds, flags for C++0x/C++11 support.

Tracking

Refactor Progress #32


I have to edit the source to get rid of the ridiculous macro incompatibility.

#define VERSION QString(NIFSKOPE_VERSION).replace("\"", "")
#define REVISION QString(NIFSKOPE_REVISION).replace("\"", "")

I add an additional set of quotes so that VS2010+ stops erroring during compile. I then run it through this macro so that the strings come out the same no matter what platform it's built on.

Settings Restructure

Note: This issue as outlined is outdated and Settings was restructured in a different way.

Proposed Settings Outline

  • Settings (Top-level, visible on Menu Bar)
    • Game Locations / Install Paths
    • Render
    • Export/Import
    • Region / Language
    • Startup Defaults (NIF versions)

Task List

  • Relocate "Settings" submenu out from under "Render" category to top-level menu on menubar[1]
  • Structure submenu according to outline indicated above.
  • Separate Texture Path settings out into its own Settings submenu[2]
  • Separate Render, Export, Region, Startup out into their own submenus[3]

[1] Find a more appropriate location to put settings menu option as its both hard to find and the setting options do not necessarily correspond to "Render".
[2] Users also have difficulty locating Texture path detection/setup because its hidden in here too.
[3] These submenus under Settings can just be a shortcut to the respective tab in one large settings widget. That way to get between settings categories you don't need to close one window and go back into Settings > [Menu you're trying to switch to]. Putting each of these in a visible dropdown menu will make them more user accessible.

Related Issues

#25 Render Settings & View enhancements

Tracking

Refactor Progress #32

BSEffectShaderProperty blocks with a Source Texture lack Edit UV support

For an NiTriShape which contains a BSEffectShaderProperty, right-clicking Texture > Edit UV gives the error:

"Could not load texture data for UV editor." 

Edit UV does not show up on the NiTriShapeData block's context menu.


(Note to self: There also needs to be a recursive check so that Edit UV does not show on parent blocks when the child does not have a Source Texture)

Confirm Quit / Discard Changes dialog

There should either be a setting where a user can choose to have NifSkope ask if you are sure you would like to quit, or NifSkope should detect when there have been modifications to a NIF and prompt if you would like to discard the changes. Or both.

BSLODTriShape lacks Spells support

A BSLODTriShape loses the:

Texture
Mesh
Flags
Transform (sub-options)

...options in the Right-Click context menu.

Most critically (IMO) is the fact that Update All Tangent Spaces, et al., do not apply to BSLODTriShape. One may think that the tangent spaces get updated on all TriShapes, but they do not.

The only workaround to use UV Edit, Update Tangent Space, etc. is to temporarily rename the block to NiTriShape.

Installer make target (NSIS or alternative)

[ticket WIP]

Since the project structure and codebase (Qt version) have changed a lot, both the win-install and linux-install targets are effectively broken. I think most of us agree we don't like NSIS, and there are several alternatives.

Options

  • NSIS (What's currently in the repo)
    • Downside: Archaic.
    • Advantage: ?. Haven't looked into it enough.
  • Qt Installer Framework
    • Downside: Large executable size.
    • Advantage: Super easy to make. I took about 5 minutes to create a basic installer[1]
    • Advantage: Can make online installers. Connect to a repository. Updating NifSkope or the XML files could be a matter of running the update tool, and checking for updates.
  • ???

[1]: Fig. 1
nifskopesetup
(Ignore the actual content of the installer.) :)

For example I'd rather say "NIF File Format Documentation" to differentiate between that and the NifSkope API docs. Speaking of, an online installer would make including the rather large API docs possible for anyone who would want them. They're rather large currently (100MB). Here's an example of the current Doxygen output. Linking to the main NifSkope class because I think the collaboration diagram is funny. :)

Tracking

Refactor Progress #32

[Tracking] Refactor Progress

For discussion and tracking of refactor issues.

Current Issues

#28 Qt 5 Port READY
#36 FSEngine Refactor READY
#31 Project Restructure READY
#27 NifSkope.pro file cleanup READY
#24 Separate UI display from logic
#13 Settings Restructure
#11 Revert change which undid separate registry settings per version
#40 Installer make target (NSIS, or alternative)
#41 Post-Qt4 Port: Code Review, Refactor

Todo Issues (Not yet ticketed)

  • Code style cleanup
  • Include file cleanup
  • Code restructure

Ideas for Discussion

  • Refactor checkVersion() etc? They are currently not very user-readable. At the very least overload with string as parameter (e.g. 20.0.0.5) if not also having some kind of constants for the various game <-> NIF combinations.
  • Coding conventions.
  • Debugging conventions. I propose leaving the code cleaner by not using macros heavily (i.e. QT_NO_DEBUG) and instead leaving qDebug() where ever we please and opting to define QT_NO_DEBUG_OUTPUT or QT_NO_WARNING_OUTPUT for release builds in NifSkope.pro, which compiles away the debug statements.

Completed

  1. Complete Qt 5 port. (#28)
  2. Refactor FSEngine. (#36)
  3. Restructure project code, simultaneously cleanup NifSkope.pro. (#31, #27)

Roadmap

  1. Post-Qt4 code review and refactor. (#41)
  2. Separate UI display from business logic as much as possible. (#24)
  3. Restructure the menus, by taking Settings out of Render menu. (#13)
  4. Consider how to handle registry settings between versions. (#11)

Command line arguments, batch scripting

[Outline WIP]

It would be nice to implement some basic command line arguments in order to allow for batch editing of NIF files directly through NifSkope. My example use case is Update All Tangent Spaces... these get corrupted easily during import/export and ensuring they are sound manually is tedious for many NIFs. Any Spell could be a candidate of course.

There are significant hurdles in implementing this, and it's very formative at this point.

First, the program already assumes only one argument, a filepath. This is utilized when dragging a file to the executable. It would be the same to call:

NifSkope.exe farmhouse01.nif

... via the command line. (Listing multiple NIFs does not open multiple application windows.)

Render Settings & View enhancements

Expose Addt'l Render Settings

Many more render settings can be exposed to the user. Just off the top of my head:

  • Vertex Size
  • Wire width
  • Normal/(Bi)Tangent handle size
  • FOV (field of view) for perspective camera
  • Camera Move & Rotation speeds

I have already done two of these in misc. builds. I also just discovered that FPS is strangely set to 25, which must be due to European developers. This FPS limit should either be configurable or dependent on refresh rate.

Usability Enhancements in Render View

Also, not just limited to Render > Settings, there are many other things that can be toggled by the user to ease NIF editing:

  • Texture toggle[1] | Shortcut: Alt+T
  • Vertex Color toggle | Shortcut: Alt+V
  • Shaded / Flat Lighting toggles[2]
  • Force Double Sided toggle
  • (Solid / Transparent / Wireframe) toggle [3]
  • Mesh (block) visibility [4]
  • (Normal / Alpha / Specular / etc) as Diffuse toggles [5]

[1]: In addition to or in lieu of setting in Render > Settings
[2]: For visualizing diffuse maps and vertex colors more clearly
[3]: For visualizing mesh interiors and collision coverage
[4]: For visualizing blocks hidden by others. Note: This currently requires at least one mesh to be visible or the view stops rendering. This can be fixed.
[5]: Since the shader pipeline appears broken to me (it's always fixed function) at least temporarily allow user to view normal maps, etc. in place of diffuse map.

BSWaterShaderProperty

NifSkope still gives a warning:

Unknown property: "BSWaterShaderProperty"

Should at least make the warning go away, if not try to improve support for it also.

Switch from GLee to GLEW

GLee is now defunct. GLEW is current and actively developed.

In my attempts at testing a port from Qt 4.8 > Qt 5.2, GLee breaks in a major way. Figuring out the issue was hard because GLee is long since deprecated.


Note: The issue could have been entirely on Qt's end. I am not exactly sure what changed with OpenGL between 4.8 and 5.2. I know that Qt has only ever had support for OpenGL ES 2.0 spec by default. It seems that I can build Qt with support for full OpenGL by using configure -opengl desktop yet I haven't looked into whether Qt even supports fixed function pipeline with their OpenGL wrappers.

Dragging multiple files to executable

Currently dragging more than one file to the NifSkope executable results in only the last file opening. Instead an application window should open for each file.

Same goes for:

NifSkope.exe farmhouse01.nif farmhouse02.nif

... via the command line.

Related

#45 Command line arguments, batch scripting
#35 GLView Widget - Drag/Drop events

Tooltips: General Usability Issues

Large tooltips like enum type descriptions can take a long time to load, and they are computed continuously as you hover. Take for example the Havok collision layers or materials. In the Type column, hover over the enum type and it will take a long time to load, and it never loads the same way twice. It's pretty much impossible to read and if it loads well, it might still disappear before you can even read it. I've already refactored the method some to deal with it, but it's not helping, as the sluggishness seems to stem from the UI having to parse such a large HTML table. The method is QString NifValue::typeDescription( const QString & typId ) in nifvalue.cpp

I propose a few options:

  1. A dedicated widget (like Inspector view) which displays the descriptions for highlighted cells.
  2. A button on the cell which opens a modal window with the description.

We could then keep the problematic descriptions from popping up in a tooltip and to view the descriptions you need to use another method.


Secondary Issues

Enum type descriptions are unordered too, because they are stored in a QHash.

Task List

  • Attempt to make tooltips more "stable" by improving their display/hide time or changing how they are toggled.
  • Consider moving certain tooltips to a widget or modal to improve usability.
  • Fix formatting issues with various descriptions.
  • Fix sorting issues with enum type descriptions and any others.

Collision display enhancements

Tasks

  • Display toggle shortcut (H)
  • Display cycles through OFF, WIRE, SOLID+WIRE
  • Fix display of CVS

Descriptions

Add keyboard shortcut

Many of the features should be given keyboard shortcuts. We should either include the shortcuts with each feature improvement, or save them for all at once.

Add new display mode (SOLID+WIRE)

The collision currently only displays as a wire. For complex shapes this does not give you a good idea of the "coverage", or how accurately it fits the shape. A new mode should be added which fills in the surfaces so that the faces can be seen.

Improve ConvexVerticesShape implementation

The convex hull algorithm uses a naive algorithm. It does not generate an actual convex hull. It instead draws an edge between every combination of vertices.

BSFurnitureMarker has new format, causing markers to no longer display

BSFurnitureMarker has a new format as of 20.2.0.7. It uses a bitflag to store multiple entry points per position, versus just one.

Unfortunately the origin for the markers has also changed. Instead of being at the standing position it is at the sitting/sleeping position. I've already created new vertex arrays for this, but the exact Z-pos (height) is unknown since Bethesda appears to have placed the ass/back of the character at the origin. Previously the markers just had the feet standing on the origin.


Also... What on earth does this possibly mean:

    float roll = float( orient ) / 6284.0 * 2.0 * (-M_PI);

glnode.cpp#L1710

It's just the same as dividing by -100, no? The gl function expects radians, which I tested myself.

Revert change which undid separate registry settings per version

We should possibly revert 2862caa which got rid of a separate registry group for each version. Or more simply restore / improve on the behavior.

I ran into an issue where my installed version and dev version somehow corrupted the render view settings, so I think it may be best to sort out some of the settings into a per-version registry entry again.

Some should be just shared across all versions, such as Texture Paths.

Update

Currently, going from 1.2.0a1.dev19 to 1.2.0a1.dev20 will cause the UI to reset. This is annoying for testers.

Upon looking into this further, the only reason the settings are cleared is not for differing NifSkope versions, but differing Qt versions.

Going forward, the Qt version should be stored in the settings alongside the NifSkope version. Unfortunately, since the settings have been reduced to one setting group across NifSkope versions, there is no way to allow later versions of NifSkope to operate alongside 1.1.3 without each other clearing the settings. Thus reverting back to settings groups for each version is necessary, or at the very least create a new settings group going forward, and abandon the old registry values and leave those for legacy versions.

Settings that aren't binary (and thus Qt-version dependent) can still be migrated from pre-1.2.0 installations to a new registry location.

So, for new installations of NifSkope, all registry values will be in the new locations. For existing installations of NifSkope, the first time NifSkope is run, any settings that can be migrated will. That way NifSkope 1.2.0+ will no longer see the pre-1.2.0 settings.

Tracking

Refactor Progress #32

Post Port: Code review, refactor

While the actual NifSkope codebase didn't require too many changes, Qt underwent a pretty drastic overhaul between 4.8 and 5.2. They deprecate code starting in one version, and then make it obsolete in a later version. This all happens silently unfortunately, and you have to actually study which classes and methods have been deprecated or made obsolete.

Also, this normally shouldn't happen, but code can change behavior between versions. For example, file filters in dialog windows stopped working. I've already fixed it, but more strangely, I can't find any explanation as to why *.nif used to work, but now I need NIF (*.nif). Another example, double-clicking/dragging NIFs to open up the program stopped working because of some changes to QUrl (also fixed).

See:

Obsolete Classes
Qt Coding Style
Qt Coding Conventions

Task List

  • Remove Qt4-specific code
  • Cross-reference deprecated/obsolete code between 4.8 and 5.2 with the NifSkope codebase. Replace obsolete code, optionally replace deprecated code, or leave a TODO.
  • Where there are new classes/methods available to improve or simplify the codebase, do so. This was a bit too vague to be a checkable task, and is an ongoing goal.
  • Use Q_UNUSED to clean up warnings.
  • Clean up whitespace.
  • Consistent code style.
  • Invert conditions to reduce nesting.
  • Remove unnecessary "if/else return" nesting.
  • Move from QRegExp to QRegularExpression

Deferred Tasks

  • Clean up comments (formatting, spelling, grammar). NEEDS FUTURE TICKET

And also, while not a quantifiable task for the task list, the program should be tested rigorously in order to find any areas that could have broken during the port, like the aforementioned QUrl / file issues.

Tracking

Refactor Progress #32

Cleanup unused strings in resulting Nif's

Nifskope doesn't clear unused strings after deletion its instance\place where it was used and its causing some problems to me, I can't reorganise NIf as I want, also I need to include small program to Nif that creates reverse animation for direct animation :) (p.s, I having math)

[Tracking] NifSkope API Documentation

Task List

  • Remove hacking.h
  • Use Markdown file as main page plus all other non-source documentation.
  • Create high level overview of application structure
    • Viewport programming
    • UI programming

No Documentation

Headers

  • gl/glmarker.h
  • gl/glnode.h
  • gl/glparticles.h
  • gl/glscene.h
  • importex/3ds.h
  • spells/transform.h
  • widgets/nifcheckboxlist.h
  • widgets/nifeditor.h
  • widgets/xmlcheck.h (almost no)
  • kfmmodel.h
  • message.h
  • nifexpr.h
  • nifproxy.h
  • nvtristripwrapper.h

Source

[WIP]

Insufficient Documentation

Headers

[WIP]

Source

[WIP]

File commands (e.g. "Open With...", "Show in Folder")

A number of useful commands should be implemented to help with file management.

"Extract File" (or "Export File to...") is needed to write files to the filesystem which are unpacked into memory from a BSA. Something like "Export All" could give you the loose files needed by the NIF to function.

"Show in Folder" would work like any other program, opening up an explorer window at the file's location. Should only show if file exists on the filesystem already.

"Open With..." would open the file in an associated program. Unfortunately I don't know about the permissions required to do such things yet. I am not sure you could look at the shell commands / default programs for a certain file extension without running the program as administrator. The alternative would be to have a setting where you can tell NifSkope what application to use. If neither of these are easy to implement, "Open in Folder" is sufficient.

Task List

  • Extract/Export File
  • Export All
  • Open With...
  • Show in Folder

Export UV template

Exporting UV template to .tga produces an empty map.

  • only nitrishape blocks allow uv template generation

Example:
sprigganmatron.nif

1.1.3
1 1 3

Dev
1 1 4

There may be some explanation as to why it's that color.

"Create Convex Shape" spell creates broken collision

Related: Issue #3

Not only does it generate it at 10x the size, I cannot get it to appear at all in the CK Preview with some meshes[1], and despite scaling it to 0.10 in a parent NiNode, it still appears 10x larger on files where it actually worked.[2]

It does show up in my dev version where all other collision displays correctly, but it is gigantic.

Given the inconsistencies I believe something more is going on here than just the scaling issue. (See comments)


Examples:
[1]: nordiccoffinstatic01.nif
[2]: basket01.nif


Sub-Issues:

  • The spell assumes a radius of 0.1, which is actually pretty high. A large amount of bhkCVS have a radius of 0.00, but the vast majority use 0.05.

Add a "Restore Defaults" function which clears stored settings

My settings recently became corrupted while juggling multiple NifSkope versions (see #11). On mesh load the camera was at the origin in Walk mode, which is usually inside the mesh. Normally it centers the mesh in view.

Thus a "Restore Defaults" option should be added to revert all stored settings.

BSMultiBound support

Like BSBound (glnode.cpp#L1667) we should think about displaying these bounding boxes. Currently BSBound is linked with Havok, though I don't know if that makes the most sense.

Instead a separate "Draw Bounds" option could be created, because many many meshes have a MultiBoundOBB which encompass the entire mesh, and linking this to "Draw Havok" would be a nuisance.

This would help visualize and give the ability to create or improve on bounds.

Task List

  • Move Bounds nodes out of drawHavok
  • Display BSMultiBounds
  • Add spells: Create BSMultiBound, Update BSMultiBound

GLView Widget - Drag/Drop events

There is currently a rather outdated block of code for the GLView widget which defines behavior for dragging files to the viewport.

Methods are:

GLView::dragEnterEvent
GLView::dragMoveEvent
GLView::dropEvent
GLView::dragLeaveEvent

Currently it seems to only allow dragging a texture file onto a block which has an NiTexturingProperty, and nothing else.

Ideas

  • Drag NIFs into scene[1].
  • Support newer texture blocks (BSShaderTextureSets, etc.)
  • Support diffuse/normal/etc. files by assigning them to the proper texture slot.
  • Prompt user in the case of overwriting of existing texture properties.
  • Drag other files? KF, etc.?

[1]: Analogous to 3ds Max's functionality with MAX files, where you are given the option to replace the scene with the file or merge the file into the existing scene. This touches a lot more functionality in the codebase than just GLView however, which would require work from Issue #18 (Header Strings enhancements).

Project Restructure

[WIP]

nifskope
+---build
|   *.bat
|   *.in
|   *.sh
+---dep
|   *.dll
+---docsys @ cf44594
+---include [Optional?]
+---install
|   +---linux-install
|   +---win-install
+---lib
|   +---fsengine
|   +---NvTriStrip
|   +---qhull @ 60d5581
+---res
|   +---icon [Move current resources to icon subdir?]
|   +---lang
|   |   *.ts
|   +---shaders
|   |   *.frag
|   |   *.prog
|   |   *.vert
|   +---ui
|   |   *.ui
|   *.ico
|   *.png
|   *.qrc
|   *.qss
|   *.rc
+---src
|   +---gl
|   +---importex
|   +---spells
|   +---ui
|   +---widgets
|   *.cpp
+---test
|   .gitattributes
|   .gitignore
|   .gitmodules
|   CHANGELOG.TXT [Change to GitHub Readme format?]
|   LICENSE.TXT [Change to GitHub Readme format?]
|   TODO.TXT [Legacy?]
|   VERSION [Put in \build instead?]

I put some comments in brackets. To elaborate:

  • Icon PNGs currently in resources should possibly be moved to their own subdir res\icons
  • Include directory optional? NifSkope.pro might be sufficient in giving anything under lib a public interface.
  • Change TXT files to GitHub readme format?
  • Remove TODO? Take anything useful and turn it into an issue.
  • Put VERSION in build? Depends on if the .PRO should go in build or the root.

Changes will need to be reflected in:

  • NifSkope.pro
    • Change paths to source, resources, headers, libs
    • If using separate include dir, add to the path so header includes can remain simple
  • .gitmodules - The submodules will need their "path" value changed

Tracking

Refactor Progress #32

Header Strings enhancements

Block names are stored in the header and referenced by index. This reference gets muddled when copy/pasting blocks into new NIFs. It does not bring the actual strings over with it, but references the string at the same index.

It may be possible to reconcile differences between the string indices by adding all the strings which are needed by the block/branch to the end of the strings and modifying the pasted blocks' indices to point to the new location.

However such repeated actions over time could cause a lot of header string cruft. Might be worth looking into to make a Spell which removes unused strings.

Task List

  • Source -> Destination header string reconciliation and integration.
  • Spell which removes unused Strings.
  • Allow reorganization of Strings. Deferred for new dedicated ticket
  • Improve method of reassigning Strings (Clicking the "TXT" button is a little obscure) Deferred for new dedicated ticket (same ticket as above item)

FSEngine Refactor

FSEngine relies on API that has become private in Qt 5. To replace it this API first needs to be stripped out and then refactor wherever the code has assumed the virtual filesystem.

experimental/fsengine

I have it solved for the most part. The "Resource Files" works just as before, but there are a few other places (Spells and such) that assume the virtual filesystem.

Replace QAbstractFileEngine with QFile/QFileInfo

Everything necessary can be replicated using QFile and QFileInfo.

Remove FSArchiveEngine, FSArchiveHandler, BSAIterator

These were classes to extend the virtual filesystem and utilized QAbstractFileEngine, QAbstractFileEngineHandler, and QAbstractFileEngineIterator, respectively.

Add QByteArray member data to Tex struct

Each texture that gets loaded is represented as a Tex object. For textures which load from BSAs, store the raw data directly on the Tex. Elsewhere, check if the data is not empty. If the data is not empty, the texture is not on the filesystem.

Wherever a QFile is assumed (to read texture data), add a QBuffer branch which will read the raw data on the Tex into memory.

Related

#28 Qt 5 Port

Tracking

Refactor Progress #32

Investigate fixed-function vs shader pipeline

Many Skyrim NIFs do not use the shader pipeline. Some do use the shader pipeline. It is unclear at the moment what causes this, but it's likely due to changes to the NIF format and how the code conditionalizes whether or not to use shaders.

Shader pipeline example: sprigganmatron.nif

Fixed function example: farmhouse01.nif (or basically any architecture)

Shader pipeline also continues to work after switching to GLEW.

Tracking

#56 OpenGL Refactoring

Blocking

#23 Switch from GLee to GLEW NOTE: May get rid of GLee or GLEW entire and use Qt 5.2 native functions

#28 Qt 5 Port

Transform > Edit - Header String editing

If you right click a mesh, and go to Transform > Edit, anything you type in the Name box will get turned immediately into a string, in real time. Meaning if you type "House", the following strings will be generated:

H
Ho
Hou
Hous
House

This is a pretty big bug. Solution being that I'm just going to strip it out, and compensate with the header string improvements in Issue #18.

Show Header/Footer by default

As a user I expect to see all the blocks available in the nif file.
Default behaviour is to hide the header/footer blocks.
A user has to use the Reset Details button before they are presented in the UI.

Multi-block select

In List View, as a user I expect to be able to select multiple blocks, individually using Ctrl + LMB, or a selection of blocks between 2 given blocks, using Shift + LMB.

Header : Num Blocks resetting.

As a user I update Num Blocks in the NiHeader.
Refreshing the Block Index Type & Block Size, then length of each is now "num blocks".
When I go to save it updates the "Num blocks", Block Index Type & Block Sizes lenghts according to the list/tree view.

I expect that the values I set should not update. The exceptions being, insertion of blocks manually or copy-pasting branches/blocks and deleting of blocks

Dev- and Linux-specific code

There is a lot of code that searches for directories and such that is specific either to dev builds (builds within the repo source dir) or the Linux platform (/usr/share) without any kind of preprocessor defs.

Personally, my take is that going forward, the NifSkope.pro file (#27) will be responsible for handling the shuffling around of data during a build. I already copy the required DLLs (if on Windows), the shader and lang folders, etc. to the build directory using QMAKE_POST_LINK. I think that qmake is perfectly acceptable for the Linux build as well, and it would make the most sense to have one platform-agnostic makefile.

Furthermore, if any of this dev-specific code is left in at all, the paths need to change as the source has been restructured (#31).

Chinese Translation Issue

A user on sf.net - icedream has provided a chinese translation.

I've done a Chinese translation.

Problems are some icons doesn't show correctly if I've translated the strings, this is the screenshot:

txt_issue

Another problem is that "Continue" has two meanings in spells/blocks.cpp, one for continue/cancel, one for Collision Detection, but I can't separate them for two meanings.

Also, some strings should have been translable but not yet, such as the menu "Spells", redo/redo in UV editor.

  • Some icons don't show correctly if using translated strings, see screenshot:
  • "Continue" has two meanings in spells/blocks.cpp, one for continue/cancel, one for Collision Detection, but I can't separate them for two meanings.
  • Missing strings that should have been translatable but not yet implemented, such as the menu "Spells", redo/redo in UV editor.

Message handling, debugging

There's no way of knowing offhand what messages are meant for the end-user and which are truly for debugging. Many errors are a mix of qDebug(), qWarning(), qCritical(), qFatal() and actual QMessageBox classes.

Should probably explicitly call QMessageBox for messages intended for the user, and define QT_NO_DEBUG_OUTPUT and QT_NO_WARNING_OUTPUT for release builds so that those calls are optimized away during compilation.

Also, see: Debugging Techniques

It suggests defining QT_MESSAGE_PATTERN to make debug messages more useful. I misread it as being a define, when it is in fact an environment variable.

Task List

  • Remove NO_MESSAGEHANDLER. (See also: #27)
  • Promote any qDebug() and qWarning() calls which are meant for end user to qCritical() or higher, or a QMessageBox proper.
  • Define QT_NO_DEBUG_OUTPUT (and possibly QT_NO_WARNING_OUTPUT) for release builds.

Invalid Tasks

  • Define QT_MESSAGE_PATTERN for more informative debug output. Guess this is an environment variable, NOT a define.

Qt 5 Port

Qt 4.8 is becoming antiquated. Porting to Qt 5 will ease some issues regarding compilation, by having more current tools and packages to work with. There are of course many other benefits but it is pointless listing them.

I have already begun, but there currently a few issues. I disabled a few non-essential elements temporarily. These are due to some methods and classes going obsolete.

Issues

See:

Breaking Changes

QFSFileEngine, QAbstractFileEngine, QAbstractFileEngineIterator, and QAbstractFileEngineHandler are no longer public.

This is the basis of the FSEngine code, and the way of opening resources (BSAs). Some alternative needs to be found.

Update: I believe we are going to decide to take this out for the time being. It didn't appear fully implemented to begin with, and as far as I could tell only allowed you to treat uncompressed BSAs as if they were a directory, therefore accessing textures for the models without needing the loose files.


Trivial

QSystemLocale is not public anymore. RESOLVED

This is a non-issue. NifSystemLocale extends this class, but as far as I can tell it's never actually used. If it were to be used QLocale is an option.

toAscii() and fromAscii() Methods are deprecated RESOLVED

Simple enough. Just replace with toLatin1() / fromLatin1().

QIcon() constructor changes RESOLVED

You can no longer give QIcon() a raw string. You must wrap it with a QPixMap() constructor.

Affected Methods/Files:
  • spells/headerstring.cpp@L73
  • spells/light.cpp@L61
  • spells/material.cpp@L101
  • spells/stringpalette.cpp@L78
  • spells/texture.cpp@L157
  • spells/transform.cpp@L277
  • widgets/colorwheel.cpp@L118
QWidget::setShown() is no longer forwarded to ::setVisible() RESOLVED

QWidget::setShown() is part of an ancient Qt3Support API which no longer exists as of Qt5.

Affected Files:
  • widgets/valueedit.cpp
QObject::trUtf8 and QCoreApplication::Encoding enums are deprecated. RESOLVED

There is one location in the code where this applies, and the solution is simply removing that parameter as it's now that way be default. So a non-issue. I can't even find where I made this change in the code... ๐Ÿ’ญ I know that it was an issue during compile, but I've scoured through every change in my commits and I can't seem to find it.

These above issues are all forward-compatible changes. They could be fixed in the Qt 4 branch.


Miscellaneous

There are a few other odd errors I need to look into. I will comment on these below.

Tracking

Refactor Progress #32

Display bhkCompressedMeshShape collision

By far the most common collision type in Skyrim is bhkCMS. Visualizing it would be a tremendous improvement.

I already have it done, just creating a ticket for documentation. ๐Ÿ˜ƒ

mcusr87

Untickable item in bitflags

In case that in nif.xml there is bitflags component containing only one option, its item in NifSkope is untickable.

Example: meshes\terrain\blackreach\blackreach.4.-3.-1.btr

  1. Edit any value located in BSSegmentedTriShape > Segment > Flags.
  2. Select BSSEG_WATER and complete edit.
  3. Edit value again and attempt to untick the value.

It actually goes beyond just bitflags with one option.

Example: BSLightingShaderProperty.

  1. Untick all options in SLSF1. Complete the edit.
  2. Edit again, select only one the first option e.g. SLSF1_Specular. Complete the edit.
  3. Edit again, try to untick the one first option.

To untick them all again you must tick hover over a second option's checkbox and then the first checkbox works. This is why bitflags with one option can never work.

This means that it's not a data issue but a UI issue. Basically the UI logic for the checkbox is not getting initialized until you mess with other checkboxes.


Edit: Seems to only happen when leaving only the first option in the list checked. Checking/unchecking the second option only works fine, e.g. SLSF1_Skinned.
Edit2: Actually you only need to hover on another checkbox, not tick it, and then you can untick the first option.
Edit3: Actually, if you carefully attempt to hover on any singularly checked checkbox no matter the index in the list, it is seen as inactive until you hover over any of the other checkboxes. So if you have only one checked option, it can be anywhere in the list. When you expand the dropdown, be careful not to hover on any item other than the checked one. You cannot interact with this item until you hover on another item in the list.

Compile error on Mac OS X

/nifskope/gl/GLee.h:765: error: typedef redefinition with different types ('int' vs 'void *')

In GLee.h the following is defined

ifndef GL_ARB_shader_objects

typedef int GLhandleARB;
typedef char GLcharARB;

endif

But in gltypes.h it is defined as

ifndef GL_ARB_shader_objects

typedef char GLcharARB;
typedef void *GLhandleARB;

endif

This gltypes in what is on my macbook running the latest osx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.