mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-06-12 06:03:08 +08:00
Material comment details
This commit is contained in:
54
dist/ueblueprint.js
vendored
54
dist/ueblueprint.js
vendored
@@ -154,6 +154,7 @@ class Configuration {
|
|||||||
makeSet: "/Script/BlueprintGraph.K2Node_MakeSet",
|
makeSet: "/Script/BlueprintGraph.K2Node_MakeSet",
|
||||||
materialExpressionConstant2Vector: "/Script/Engine.MaterialExpressionConstant2Vector",
|
materialExpressionConstant2Vector: "/Script/Engine.MaterialExpressionConstant2Vector",
|
||||||
materialExpressionTextureCoordinate: "/Script/Engine.MaterialExpressionTextureCoordinate",
|
materialExpressionTextureCoordinate: "/Script/Engine.MaterialExpressionTextureCoordinate",
|
||||||
|
materialGraphNodeComment: "/Script/UnrealEd.MaterialGraphNode_Comment",
|
||||||
materialGraphNode: "/Script/UnrealEd.MaterialGraphNode",
|
materialGraphNode: "/Script/UnrealEd.MaterialGraphNode",
|
||||||
multiGate: "/Script/BlueprintGraph.K2Node_MultiGate",
|
multiGate: "/Script/BlueprintGraph.K2Node_MultiGate",
|
||||||
pawn: "/Script/Engine.Pawn",
|
pawn: "/Script/Engine.Pawn",
|
||||||
@@ -2918,6 +2919,14 @@ class ObjectEntity extends IEntity {
|
|||||||
type: GuidEntity,
|
type: GuidEntity,
|
||||||
showDefault: false,
|
showDefault: false,
|
||||||
},
|
},
|
||||||
|
SizeX: {
|
||||||
|
type: IntegerEntity,
|
||||||
|
showDefault: false,
|
||||||
|
},
|
||||||
|
SizeY: {
|
||||||
|
type: IntegerEntity,
|
||||||
|
showDefault: false,
|
||||||
|
},
|
||||||
NodePosX: {
|
NodePosX: {
|
||||||
type: IntegerEntity,
|
type: IntegerEntity,
|
||||||
showDefault: false,
|
showDefault: false,
|
||||||
@@ -3085,9 +3094,12 @@ class ObjectEntity extends IEntity {
|
|||||||
/** @type {Number?} */ this.R;
|
/** @type {Number?} */ this.R;
|
||||||
/** @type {Number?} */ this.G;
|
/** @type {Number?} */ this.G;
|
||||||
/** @type {ObjectReferenceEntity?} */ this.MaterialExpression;
|
/** @type {ObjectReferenceEntity?} */ this.MaterialExpression;
|
||||||
|
/** @type {ObjectReferenceEntity?} */ this.MaterialExpressionComment;
|
||||||
/** @type {SymbolEntity?} */ this.MoveMode;
|
/** @type {SymbolEntity?} */ this.MoveMode;
|
||||||
/** @type {String?} */ this.TimelineName;
|
/** @type {String?} */ this.TimelineName;
|
||||||
/** @type {GuidEntity?} */ this.TimelineGuid;
|
/** @type {GuidEntity?} */ this.TimelineGuid;
|
||||||
|
/** @type {IntegerEntity?} */ this.SizeX;
|
||||||
|
/** @type {IntegerEntity?} */ this.SizeY;
|
||||||
/** @type {IntegerEntity} */ this.NodePosX;
|
/** @type {IntegerEntity} */ this.NodePosX;
|
||||||
/** @type {IntegerEntity} */ this.NodePosY;
|
/** @type {IntegerEntity} */ this.NodePosY;
|
||||||
/** @type {IntegerEntity?} */ this.NodeWidth;
|
/** @type {IntegerEntity?} */ this.NodeWidth;
|
||||||
@@ -3170,8 +3182,8 @@ class ObjectEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getNodeWidth() {
|
getNodeWidth() {
|
||||||
return this.NodeWidth ??
|
return this.NodeWidth
|
||||||
this.getType() == Configuration.paths.comment ? Configuration.defaultCommentWidth : undefined
|
?? this.isComment() ? Configuration.defaultCommentWidth : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param {Number} value */
|
/** @param {Number} value */
|
||||||
@@ -3180,11 +3192,18 @@ class ObjectEntity extends IEntity {
|
|||||||
this.NodeWidth = new IntegerEntity();
|
this.NodeWidth = new IntegerEntity();
|
||||||
}
|
}
|
||||||
this.NodeWidth.value = value;
|
this.NodeWidth.value = value;
|
||||||
|
const materialComment = this.getMaterialSubobject();
|
||||||
|
if (materialComment) {
|
||||||
|
if (!materialComment.SizeX) {
|
||||||
|
materialComment.SizeX = new IntegerEntity();
|
||||||
|
}
|
||||||
|
materialComment.SizeX.value = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getNodeHeight() {
|
getNodeHeight() {
|
||||||
return this.NodeHeight ??
|
return this.NodeHeight
|
||||||
this.getType() == Configuration.paths.comment ? Configuration.defaultCommentHeight : undefined
|
?? this.isComment() ? Configuration.defaultCommentHeight : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param {Number} value */
|
/** @param {Number} value */
|
||||||
@@ -3193,6 +3212,13 @@ class ObjectEntity extends IEntity {
|
|||||||
this.NodeHeight = new IntegerEntity();
|
this.NodeHeight = new IntegerEntity();
|
||||||
}
|
}
|
||||||
this.NodeHeight.value = value;
|
this.NodeHeight.value = value;
|
||||||
|
const materialComment = this.getMaterialSubobject();
|
||||||
|
if (materialComment) {
|
||||||
|
if (!materialComment.SizeY) {
|
||||||
|
materialComment.SizeY = new IntegerEntity();
|
||||||
|
}
|
||||||
|
materialComment.SizeY.value = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getNodePosX() {
|
getNodePosX() {
|
||||||
@@ -3249,10 +3275,27 @@ class ObjectEntity extends IEntity {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isComment() {
|
||||||
|
switch (this.getClass()) {
|
||||||
|
case Configuration.paths.comment:
|
||||||
|
case Configuration.paths.materialGraphNodeComment:
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
isMaterial() {
|
isMaterial() {
|
||||||
return this.getClass() === Configuration.paths.materialGraphNode || this.MaterialExpression !== undefined
|
return this.getClass() === Configuration.paths.materialGraphNode || this.MaterialExpression !== undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return {ObjectEntity} */
|
||||||
|
getMaterialSubobject() {
|
||||||
|
const expression = this.MaterialExpression ?? this.MaterialExpressionComment;
|
||||||
|
return expression
|
||||||
|
? this[Configuration.subObjectAttributeNameFromReference(expression, true)]
|
||||||
|
: null
|
||||||
|
}
|
||||||
|
|
||||||
isDevelopmentOnly() {
|
isDevelopmentOnly() {
|
||||||
const nodeClass = this.getClass();
|
const nodeClass = this.getClass();
|
||||||
return this.EnabledState?.toString() === "DevelopmentOnly"
|
return this.EnabledState?.toString() === "DevelopmentOnly"
|
||||||
@@ -5914,6 +5957,7 @@ class BlueprintTemplate extends ITemplate {
|
|||||||
getCommentNodes(justSelected = false) {
|
getCommentNodes(justSelected = false) {
|
||||||
return this.blueprint.querySelectorAll(
|
return this.blueprint.querySelectorAll(
|
||||||
`ueb-node[data-type="${Configuration.paths.comment}"]${justSelected ? '[data-selected="true"]' : ''}`
|
`ueb-node[data-type="${Configuration.paths.comment}"]${justSelected ? '[data-selected="true"]' : ''}`
|
||||||
|
+ `, ueb-node[data-type="${Configuration.paths.materialGraphNodeComment}"]${justSelected ? '[data-selected="true"]' : ''}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8069,6 +8113,7 @@ class NodeElement extends ISelectableDraggableElement {
|
|||||||
}
|
}
|
||||||
switch (nodeEntity.getClass()) {
|
switch (nodeEntity.getClass()) {
|
||||||
case Configuration.paths.comment:
|
case Configuration.paths.comment:
|
||||||
|
case Configuration.paths.materialGraphNodeComment:
|
||||||
return CommentNodeTemplate
|
return CommentNodeTemplate
|
||||||
case Configuration.paths.createDelegate:
|
case Configuration.paths.createDelegate:
|
||||||
return NodeTemplate
|
return NodeTemplate
|
||||||
@@ -10099,7 +10144,6 @@ class PinElement extends IElement {
|
|||||||
"MUTABLE_REFERENCE": ReferencePinTemplate,
|
"MUTABLE_REFERENCE": ReferencePinTemplate,
|
||||||
"name": NamePinTemplate,
|
"name": NamePinTemplate,
|
||||||
"real": RealPinTemplate,
|
"real": RealPinTemplate,
|
||||||
"red": RealPinTemplate,
|
|
||||||
"string": StringPinTemplate,
|
"string": StringPinTemplate,
|
||||||
[Configuration.paths.linearColor]: LinearColorPinTemplate,
|
[Configuration.paths.linearColor]: LinearColorPinTemplate,
|
||||||
[Configuration.paths.rotator]: RotatorPinTemplate,
|
[Configuration.paths.rotator]: RotatorPinTemplate,
|
||||||
|
|||||||
6
dist/ueblueprint.min.js
vendored
6
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -130,6 +130,7 @@ export default class Configuration {
|
|||||||
makeSet: "/Script/BlueprintGraph.K2Node_MakeSet",
|
makeSet: "/Script/BlueprintGraph.K2Node_MakeSet",
|
||||||
materialExpressionConstant2Vector: "/Script/Engine.MaterialExpressionConstant2Vector",
|
materialExpressionConstant2Vector: "/Script/Engine.MaterialExpressionConstant2Vector",
|
||||||
materialExpressionTextureCoordinate: "/Script/Engine.MaterialExpressionTextureCoordinate",
|
materialExpressionTextureCoordinate: "/Script/Engine.MaterialExpressionTextureCoordinate",
|
||||||
|
materialGraphNodeComment: "/Script/UnrealEd.MaterialGraphNode_Comment",
|
||||||
materialGraphNode: "/Script/UnrealEd.MaterialGraphNode",
|
materialGraphNode: "/Script/UnrealEd.MaterialGraphNode",
|
||||||
multiGate: "/Script/BlueprintGraph.K2Node_MultiGate",
|
multiGate: "/Script/BlueprintGraph.K2Node_MultiGate",
|
||||||
pawn: "/Script/Engine.Pawn",
|
pawn: "/Script/Engine.Pawn",
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ export default class NodeElement extends ISelectableDraggableElement {
|
|||||||
}
|
}
|
||||||
switch (nodeEntity.getClass()) {
|
switch (nodeEntity.getClass()) {
|
||||||
case Configuration.paths.comment:
|
case Configuration.paths.comment:
|
||||||
|
case Configuration.paths.materialGraphNodeComment:
|
||||||
return CommentNodeTemplate
|
return CommentNodeTemplate
|
||||||
case Configuration.paths.createDelegate:
|
case Configuration.paths.createDelegate:
|
||||||
return NodeTemplate
|
return NodeTemplate
|
||||||
|
|||||||
@@ -173,6 +173,14 @@ export default class ObjectEntity extends IEntity {
|
|||||||
type: GuidEntity,
|
type: GuidEntity,
|
||||||
showDefault: false,
|
showDefault: false,
|
||||||
},
|
},
|
||||||
|
SizeX: {
|
||||||
|
type: IntegerEntity,
|
||||||
|
showDefault: false,
|
||||||
|
},
|
||||||
|
SizeY: {
|
||||||
|
type: IntegerEntity,
|
||||||
|
showDefault: false,
|
||||||
|
},
|
||||||
NodePosX: {
|
NodePosX: {
|
||||||
type: IntegerEntity,
|
type: IntegerEntity,
|
||||||
showDefault: false,
|
showDefault: false,
|
||||||
@@ -201,6 +209,10 @@ export default class ObjectEntity extends IEntity {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
showDefault: false,
|
showDefault: false,
|
||||||
},
|
},
|
||||||
|
Text: {
|
||||||
|
type: String,
|
||||||
|
showDefault: false,
|
||||||
|
},
|
||||||
NodeComment: {
|
NodeComment: {
|
||||||
type: String,
|
type: String,
|
||||||
showDefault: false,
|
showDefault: false,
|
||||||
@@ -340,9 +352,12 @@ export default class ObjectEntity extends IEntity {
|
|||||||
/** @type {Number?} */ this.R
|
/** @type {Number?} */ this.R
|
||||||
/** @type {Number?} */ this.G
|
/** @type {Number?} */ this.G
|
||||||
/** @type {ObjectReferenceEntity?} */ this.MaterialExpression
|
/** @type {ObjectReferenceEntity?} */ this.MaterialExpression
|
||||||
|
/** @type {ObjectReferenceEntity?} */ this.MaterialExpressionComment
|
||||||
/** @type {SymbolEntity?} */ this.MoveMode
|
/** @type {SymbolEntity?} */ this.MoveMode
|
||||||
/** @type {String?} */ this.TimelineName
|
/** @type {String?} */ this.TimelineName
|
||||||
/** @type {GuidEntity?} */ this.TimelineGuid
|
/** @type {GuidEntity?} */ this.TimelineGuid
|
||||||
|
/** @type {IntegerEntity?} */ this.SizeX
|
||||||
|
/** @type {IntegerEntity?} */ this.SizeY
|
||||||
/** @type {IntegerEntity} */ this.NodePosX
|
/** @type {IntegerEntity} */ this.NodePosX
|
||||||
/** @type {IntegerEntity} */ this.NodePosY
|
/** @type {IntegerEntity} */ this.NodePosY
|
||||||
/** @type {IntegerEntity?} */ this.NodeWidth
|
/** @type {IntegerEntity?} */ this.NodeWidth
|
||||||
@@ -350,6 +365,7 @@ export default class ObjectEntity extends IEntity {
|
|||||||
/** @type {Boolean?} */ this.bCanRenameNode
|
/** @type {Boolean?} */ this.bCanRenameNode
|
||||||
/** @type {Boolean?} */ this.bCommentBubblePinned
|
/** @type {Boolean?} */ this.bCommentBubblePinned
|
||||||
/** @type {Boolean?} */ this.bCommentBubbleVisible
|
/** @type {Boolean?} */ this.bCommentBubbleVisible
|
||||||
|
/** @type {String?} */ this.Text
|
||||||
/** @type {String?} */ this.NodeComment
|
/** @type {String?} */ this.NodeComment
|
||||||
/** @type {IdentifierEntity?} */ this.AdvancedPinDisplay
|
/** @type {IdentifierEntity?} */ this.AdvancedPinDisplay
|
||||||
/** @type {IdentifierEntity?} */ this.EnabledState
|
/** @type {IdentifierEntity?} */ this.EnabledState
|
||||||
@@ -425,8 +441,8 @@ export default class ObjectEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getNodeWidth() {
|
getNodeWidth() {
|
||||||
return this.NodeWidth ??
|
return this.NodeWidth
|
||||||
this.getType() == Configuration.paths.comment ? Configuration.defaultCommentWidth : undefined
|
?? this.isComment() ? Configuration.defaultCommentWidth : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param {Number} value */
|
/** @param {Number} value */
|
||||||
@@ -438,8 +454,8 @@ export default class ObjectEntity extends IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getNodeHeight() {
|
getNodeHeight() {
|
||||||
return this.NodeHeight ??
|
return this.NodeHeight
|
||||||
this.getType() == Configuration.paths.comment ? Configuration.defaultCommentHeight : undefined
|
?? this.isComment() ? Configuration.defaultCommentHeight : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param {Number} value */
|
/** @param {Number} value */
|
||||||
@@ -504,10 +520,27 @@ export default class ObjectEntity extends IEntity {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isComment() {
|
||||||
|
switch (this.getClass()) {
|
||||||
|
case Configuration.paths.comment:
|
||||||
|
case Configuration.paths.materialGraphNodeComment:
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
isMaterial() {
|
isMaterial() {
|
||||||
return this.getClass() === Configuration.paths.materialGraphNode || this.MaterialExpression !== undefined
|
return this.getClass() === Configuration.paths.materialGraphNode || this.MaterialExpression !== undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return {ObjectEntity} */
|
||||||
|
getMaterialSubobject() {
|
||||||
|
const expression = this.MaterialExpression ?? this.MaterialExpressionComment
|
||||||
|
return expression
|
||||||
|
? this[Configuration.subObjectAttributeNameFromReference(expression, true)]
|
||||||
|
: null
|
||||||
|
}
|
||||||
|
|
||||||
isDevelopmentOnly() {
|
isDevelopmentOnly() {
|
||||||
const nodeClass = this.getClass()
|
const nodeClass = this.getClass()
|
||||||
return this.EnabledState?.toString() === "DevelopmentOnly"
|
return this.EnabledState?.toString() === "DevelopmentOnly"
|
||||||
|
|||||||
@@ -189,6 +189,7 @@ export default class BlueprintTemplate extends ITemplate {
|
|||||||
getCommentNodes(justSelected = false) {
|
getCommentNodes(justSelected = false) {
|
||||||
return this.blueprint.querySelectorAll(
|
return this.blueprint.querySelectorAll(
|
||||||
`ueb-node[data-type="${Configuration.paths.comment}"]${justSelected ? '[data-selected="true"]' : ''}`
|
`ueb-node[data-type="${Configuration.paths.comment}"]${justSelected ? '[data-selected="true"]' : ''}`
|
||||||
|
+ `, ueb-node[data-type="${Configuration.paths.materialGraphNodeComment}"]${justSelected ? '[data-selected="true"]' : ''}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user