Skip to content

Commit

Permalink
Change resource paths
Browse files Browse the repository at this point in the history
- Add art.scnassets to podspec resources
- Add some comments
  • Loading branch information
magicien committed Sep 30, 2018
1 parent 93ffa2f commit e02088e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
4 changes: 2 additions & 2 deletions MMDSceneKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Pod::Spec.new do |s|
s.tvos.deployment_target = "11.0"
s.source = { :git => "https://github.com/magicien/MMDSceneKit.git", :tag => "v#{s.version}" }
s.source_files = "Source/**/*.{swift,metal}"
s.resources = "Source/**/*.shader", "Source/**/*.bmp"
s.resources = "Source/**/*.shader", "Source/Common/art.scnassets", "Source/Common/*.plist"
s.resource_bundles = {
"MMDSceneKit" => ["Source/**/*.shader", "Source/**/*.bmp"]
"MMDSceneKit" => ["Source/**/*.shader", "Source/Common/art.scnassets", "Source/Common/*.plist"]
}
s.pod_target_xcconfig = {
"SWIFT_VERSION" => "4.0"
Expand Down
5 changes: 4 additions & 1 deletion Source/Common/MMDCameraNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ open class MMDCameraNode: MMDNode {
private var rotYNode: SCNNode! = nil
private var rotZNode: SCNNode! = nil
private var cameraNode: SCNNode! = nil


/// x-axis rotation in radians
public var rotX: Float {
get {
return Float(self.rotXNode.eulerAngles.x)
Expand All @@ -30,6 +31,7 @@ open class MMDCameraNode: MMDNode {
}
}

/// y-axis rotation in radians
public var rotY: Float {
get {
return Float(self.rotYNode.eulerAngles.y)
Expand All @@ -39,6 +41,7 @@ open class MMDCameraNode: MMDNode {
}
}

/// z-axis rotation in radians
public var rotZ: Float {
get {
return Float(self.rotZNode.eulerAngles.z)
Expand Down
17 changes: 9 additions & 8 deletions Source/Common/MMDPMXReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1229,11 +1229,12 @@ class MMDPMXReader: MMDReader {
}

#if !os(watchOS)
/*
//print("****************** create program start ***************************")
//let program = MMDProgram()
//program.delegate = self.workingNode
let program = MMDProgram()
program.delegate = self.workingNode


/*
var path = NSBundle(forClass: MMDProgram.self).pathForResource("MMDShader", ofType: "vsh")
let vertexShader = try! String(contentsOfFile: path!, encoding: NSUTF8StringEncoding)
program.vertexShader = vertexShader
Expand All @@ -1244,12 +1245,12 @@ class MMDPMXReader: MMDReader {

program.setSemantic(SCNModelViewProjectionTransform, forSymbol: "modelViewProjectionTransform", options: nil)
program.setSemantic(SCNGeometrySourceSemanticVertex, forSymbol: "aPos", options: nil)
*/

//print("****************** create program end ***************************")
//for material in self.materialArray {
// material.program = program
//}

for material in self.materialArray {
material.program = program
}
*/

#endif

Expand Down
20 changes: 10 additions & 10 deletions Source/Common/MMDReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import Foundation
import SceneKit

let toonFiles: [String] = [
"toon01.bmp",
"toon02.bmp",
"toon03.bmp",
"toon04.bmp",
"toon05.bmp",
"toon06.bmp",
"toon07.bmp",
"toon08.bmp",
"toon09.bmp",
"toon10.bmp"
"art.scnassets/toon01.bmp",
"art.scnassets/toon02.bmp",
"art.scnassets/toon03.bmp",
"art.scnassets/toon04.bmp",
"art.scnassets/toon05.bmp",
"art.scnassets/toon06.bmp",
"art.scnassets/toon07.bmp",
"art.scnassets/toon08.bmp",
"art.scnassets/toon09.bmp",
"art.scnassets/toon10.bmp"
]

internal class MMDReader: NSObject {
Expand Down

0 comments on commit e02088e

Please sign in to comment.